:root {
  --ink: var(--mf-ink, #262626);
  --muted: var(--mf-muted, #808080);
  --accent: var(--mf-blue, #4472C4);
  --line: var(--mf-gridline, #D9D9D9);
  --panel: color-mix(in srgb, var(--mf-ink, #262626) 3%, var(--mf-bg, #fff));
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--mf-bg, #fff); color: var(--ink); font-family: var(--mf-font, Literata, Georgia, serif); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 16px 80px; }
a { color: var(--accent); }
.crumb { font-size: 14px; margin: 0 0 22px; }
h1 { font-size: 34px; line-height: 1.15; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 22px; margin: 38px 0 8px; }
h3 { font-size: 17px; margin: 26px 0 6px; }
.sub { color: var(--muted); font-size: 17px; margin: 0 0 22px; max-width: 820px; line-height: 1.5; }
.note { font-size: 14px; color: var(--muted); line-height: 1.55; margin: 0 0 12px; max-width: 880px; }
.note.fine { font-size: 12.5px; }
.note p { margin: 0 0 10px; }
.note b { color: var(--ink); }
.hint { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 13px; margin-left: 6px; }

/* hero */
.hero { border: 1px solid var(--line); border-left: 5px solid var(--accent); background: var(--panel); border-radius: 6px; padding: 20px 22px; margin: 0 0 18px; }
.hero .kicker { text-transform: uppercase; letter-spacing: .09em; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.hero .lede { font-size: 19px; line-height: 1.45; margin: 0 0 14px; max-width: 920px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: 6px; background: var(--mf-bg, #fff); min-height: 92px; padding: 10px 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; cursor: pointer; font: inherit; color: inherit; }
.tile:hover { border-color: var(--accent); }
.tile .k { font-size: 12px; color: var(--muted); line-height: 1.3; }
.tile .v { font-size: 24px; font-weight: 700; line-height: 1.2; margin: 2px 0; }
.tile .s { font-size: 11px; color: var(--muted); line-height: 1.3; }

/* controls: every button in a group the same fixed width */
.controls { border: 1px solid var(--line); border-radius: 6px; padding: 8px 16px 10px; background: var(--panel); margin: 0 0 8px; }
.ctl-row { display: flex; flex-wrap: wrap; gap: 12px 26px; align-items: flex-end; }
.ctl { margin: 6px 0 10px; }
.ctl label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { font-family: inherit; font-size: 13px; width: 120px; height: 40px; border: 0; border-right: 1px solid var(--line); background: var(--mf-bg, #fff);
  color: var(--ink); cursor: pointer; padding: 0 6px; white-space: normal; line-height: 1.15; overflow: hidden; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--mf-bg, #fff); font-weight: 600; }
.seg button:disabled { opacity: .4; cursor: default; }
.seg.wide button { width: 170px; height: 46px; }
.seg.narrow button { width: 92px; }
.seg .sw { display: inline-block; width: 16px; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: 6px; }
.seg .sw.dashed { border-top-style: dashed; }
.seg .sw.dotted { border-top-style: dotted; }
select { font: inherit; font-size: 14px; height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--mf-bg, #fff); color: var(--ink); width: 290px; max-width: 100%; }
#from { width: 110px; }
input[type="range"] { width: 320px; max-width: 100%; height: 32px; accent-color: var(--accent); }
.ctl.off { opacity: .45; }
.ctl.hide { display: none; }

/* output */
.sect-note { font-size: 14px; color: var(--muted); margin: 0 0 10px; max-width: 880px; line-height: 1.5; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 26px; }
.card { min-width: 0; border-top: 1px solid var(--line); padding-top: 10px; }
.card h3 { margin: 0 0 2px; font-size: 16px; }
.card h3 button { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.card h3 button:hover { color: var(--accent); }
.card .gapline { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.card .cnote { font-size: 12px; color: var(--muted); margin: 2px 0 0; line-height: 1.4; }
.chart { min-height: 200px; margin: 0 0 4px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
.single .chart { min-height: 260px; }

/* the bar figure (drawn here; colors read from --mf-* at load) */
.bars { margin: 6px 0 14px; }
.bars .t { font-size: var(--mf-fs-title, 15px); font-weight: 700; margin: 0 0 2px; }
.bars .u { font-size: var(--mf-fs-units, 10.5px); color: var(--muted); margin: 0 0 6px; }
.bars .lg { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; margin: 4px 0 0; }
.bars .lg span.sw { display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: -1px; border-radius: 2px; }
.bars .src { font-size: var(--mf-fs-source, 8.5px); color: var(--muted); margin-top: 4px; display: flex; justify-content: space-between; }

/* tables: every column centered, headers and values alike */
.tablewrap { overflow-x: auto; margin: 4px 0 8px; }
table.t { border-collapse: collapse; width: 100%; font-size: 14px; }
table.t th, table.t td { text-align: center; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
table.t th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
table.t td.na { color: var(--muted); }
table.t.trendtab td:nth-child(2) { white-space: normal; min-width: 220px; }
.methods p { max-width: 880px; }
@media (max-width: 760px) {
  .grid, .pair { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  h1 { font-size: 28px; }
  .hero { padding: 14px; }
  .hero .lede { font-size: 16.5px; }
  .seg button { width: 104px; font-size: 12px; }
  .seg.wide button { width: 148px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
