/* Risk Monitor. The shared vocabulary of the page, after the Recession Explorer's: wrap, crumb, sub,
   AI pill, the seven tabs, the control row, sections and their cards, figures, tables, the percentile
   chip and strip, dated text with its diamond, the quote card, the warning box. A tab's own extras go in
   its tab-<name>.css. Every color comes from the site theme: no color is named in this file. */
:root {
  --ink: var(--mf-ink);
  --muted: var(--mf-muted);
  --accent: var(--mf-blue);
  --line: var(--mf-gridline);
  --panel: color-mix(in srgb, var(--mf-gridline) 18%, var(--mf-bg));
  --warn: color-mix(in srgb, var(--mf-gold) 14%, var(--mf-bg));
  --soft: color-mix(in srgb, var(--mf-blue) 9%, var(--mf-bg));
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--mf-bg); color: var(--ink); font-family: var(--mf-font); }
[hidden] { display: none !important; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 20px 0; }
.wrap.last { padding-top: 6px; padding-bottom: 80px; }
a { color: var(--accent); }
.crumb { font-size: 14px; margin: 0 0 22px; }
h1 { font-size: 32px; line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 22px; margin: 0 0 6px; }
h3 { font-size: 17px; margin: 26px 0 8px; }
.sub { color: var(--muted); font-size: 15px; margin: 0 0 16px; max-width: 1040px; line-height: 1.5; }
.note { font-size: 14px; color: var(--muted); line-height: 1.55; margin: 0 0 14px; max-width: 900px; }
.note.small { font-size: 12.5px; }
.note.asof { margin: 0 0 4px; }
.lead { font-size: 17px; font-weight: 600; line-height: 1.45; margin: 0 0 14px; max-width: 1040px; }
.intro { font-size: 15px; line-height: 1.55; margin: 0 0 10px; max-width: 900px; }
/* a link to any part of the page lands a little clear of the top */
.wrap [id] { scroll-margin-top: 14px; }

.ai-pill { display: inline-block; font-size: 13px; font-weight: 600; color: var(--mf-red); border: 1.5px solid var(--mf-red); border-radius: 999px; padding: 4px 14px; margin: 0 0 10px; }
/* the warning box: light red */
.caution { font-size: 14px; line-height: 1.5; margin: 10px 0 0; padding: 10px 14px; border-radius: 5px;
  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)); }
.warn { color: var(--mf-red); font-weight: 600; }

/* the seven tabs: one fixed size, one row at desktop (a long name takes two lines), two to a row on a phone */
.tabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 14px; }
.tabs button { font-family: inherit; font-size: 14.5px; width: auto; height: 52px; padding: 0 6px; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; color: var(--muted); cursor: pointer; white-space: normal; line-height: 1.15; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
@media (max-width: 900px) { .tabs { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .tabs { grid-template-columns: repeat(2, 1fr); } .tabs button { height: 44px; font-size: 14px; } .tabs button:last-child { grid-column: span 2; } }
/* the way back to the tabs from deep in a long tab: shown once the tab bar has scrolled out of view */
.totabs { position: fixed; left: 16px; bottom: 16px; z-index: 20; width: 150px; height: 40px; font-family: inherit; font-size: 13.5px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--mf-bg); color: var(--accent); cursor: pointer;
  box-shadow: 0 1px 6px color-mix(in srgb, var(--mf-ink) 18%, transparent); }
.totabs[hidden] { display: none; }

/* the control row, and controls a tab draws inside its own blocks */
.controls { border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px 2px; margin: 0 0 4px; }
.ctl-row { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: flex-start; margin: 0 0 10px; }
.ctl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ctl > label, .ctl > .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink); font-weight: 600; }
.seg { display: inline-flex; align-self: flex-start; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; max-width: 100%; }
.seg button { font-family: inherit; font-size: 13px; height: 34px; width: 128px; flex-shrink: 0; border: 0; border-right: 1px solid var(--line); background: var(--mf-bg); color: var(--ink); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--mf-bg); }
.seg button:disabled { color: var(--muted); cursor: not-allowed; background: var(--panel); }
.seg.wide button { width: 164px; }
.seg.xwide button { width: 216px; }
.seg.narrow button { width: 92px; }
/* chips: one fixed size, wrapping into rows */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font-family: inherit; font-size: 13px; width: 132px; height: 34px; border: 1px solid var(--line); border-radius: 5px; background: var(--mf-bg); color: var(--ink); cursor: pointer; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips.narrow button { width: 74px; }
.chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--mf-bg); }
.chips button:disabled { color: var(--muted); cursor: not-allowed; background: var(--panel); }
.ctl > label.check, .check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; height: 34px; cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 400; }
.check input { width: 16px; height: 16px; accent-color: var(--mf-blue); }
.btn { font-family: inherit; font-size: 13px; height: 34px; width: 176px; border: 1px solid var(--line); border-radius: 5px; background: var(--mf-bg); color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--ink); }
select, input[type="month"] { font-family: inherit; font-size: 14px; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--mf-bg); color: var(--ink); max-width: 100%; }

/* a tab, its sections and its blocks */
.tab > .toc { font-size: 14px; line-height: 1.7; margin: 12px 0 10px; max-width: 1040px; }
.tab > .note { margin-top: 10px; }
.sec, .block { margin: 34px 0 0; }
.tab > .sec:first-child, .tab > .block:first-child { margin-top: 14px; }
.sec > h2, .block > h2 { border-top: 1px solid var(--line); padding-top: 16px; }
.tab > .sec:first-child > h2, .tab > .block:first-child > h2 { border-top: 0; padding-top: 0; }
.sec-body { min-width: 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.pair > * { min-width: 0; }

/* cards: a two-column grid; a wide card spans both */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; margin: 18px 0 0; align-items: start; }
.card { min-width: 0; }
.card.wide { grid-column: 1 / -1; }
.more { font-size: 13px; margin: 6px 0 0; text-align: right; }
.panel { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px 8px; background: var(--mf-bg); min-width: 0; margin: 8px 0 0; }
.cards .panel { margin-top: 0; }
.panel svg { max-width: 100%; height: auto; display: block; }
.figbox { min-width: 0; }
/* the shared download row, at a width that keeps its three buttons on one line under a half-width chart */
.wrap .ev-dlbar .ev-dl { width: 156px; }
.rx-fig { height: auto; }
.rx-fig .mf-fig-title { line-height: 1.3; }
.rx-fig .mf-fig-meta { margin-bottom: 4px; gap: 16px; }
.rx-fig .mf-fig-meta .datestamp { text-align: right; flex: 0 0 auto; max-width: 42%; }
.rx-fig .mf-fig-meta .units { font-size: 12px; line-height: 1.35; }
.rx-fig .mf-fig-foot { gap: 12px; }
.rx-fig .mf-fig-foot .src, .rx-fig .mf-fig-foot .mark { font-size: 10.5px; }
.rx-fig .mf-fig-foot .mark { flex: 0 0 auto; }
.rx-fig .mf-fig-legend { font-size: 12px; gap: 6px 16px; }
.rx-note { font-size: 12px; color: var(--muted); line-height: 1.45; margin: 6px 0 0; }
.rx-empty { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 170px; font-size: 13.5px; color: var(--muted); background: var(--panel); border-radius: 4px; padding: 14px; line-height: 1.5; }
/* a table in the figure frame: its units line is centered, like its title */
.rm-tablefig .mf-fig-meta { justify-content: center; text-align: center; }
.rm-tablefig .mf-fig-meta .datestamp:empty { display: none; }
/* something its owner has not built yet, or a hand-kept file that is not there yet */
.tocome { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 64px; font-size: 13px; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: 6px; padding: 10px 14px; margin: 8px 0 0; }

/* the percentile chip under a scored chart's title: a square of the heat-map color, then the words */
.pchip { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; margin: 1px 0 4px; }
.pchip i { width: 11px; height: 11px; border-radius: 2px; border: 1px solid var(--line); flex: 0 0 auto; }
/* the percentile and its strip in a table cell */
.pcell { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.pcell .pn { min-width: 1.6em; text-align: right; font-weight: 600; }
.pstrip { flex: 0 0 auto; }

/* tiles: content centered both ways */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 10px 0 0; }
.tile { border: 1px solid var(--line); border-radius: 6px; background: var(--mf-bg); padding: 12px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 132px; min-width: 0; }
.tile .l { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); line-height: 1.3; }
.tile .v { font-size: 26px; font-weight: 700; line-height: 1.1; margin: 7px 0 5px; white-space: nowrap; }
.tile .v.sm { font-size: 19px; white-space: normal; }
.tile .d { font-size: 12.5px; line-height: 1.35; }
.tile .o { font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 3px; }
/* a prediction market as a tile (draw.js marketTile): the question, the price, its date, the note, the link at
   the foot; three across, or two, or one held to a readable width */
.tiles.mkts { grid-template-columns: repeat(3, 1fr); align-items: stretch; margin-top: 6px; }
.tiles.mkts.two { grid-template-columns: 1fr 1fr; }
.tiles.mkts.one { grid-template-columns: minmax(0, 560px); justify-content: center; }
.tile.mkt { padding: 14px 14px 12px; justify-content: flex-start; }
.tile.mkt .q { font-size: 14px; font-weight: 600; line-height: 1.35; margin: 8px 0 0; }
.tile.mkt .v { font-size: 30px; margin: 10px 0 2px; }
.tile.mkt .o.nt { margin-top: 8px; }
.tile.mkt .lk { font-size: 12.5px; margin-top: auto; padding-top: 10px; }
@media (max-width: 900px) { .tiles.mkts, .tiles.mkts.two { grid-template-columns: 1fr; } }

/* the hover tip */
.rx-tip { position: absolute; z-index: 50; display: none; pointer-events: none; background: var(--mf-bg); border: 1px solid var(--ink); border-radius: 4px; padding: 7px 9px; font-family: var(--mf-font); font-size: 12.5px; line-height: 1.4; box-shadow: 0 2px 8px color-mix(in srgb, var(--mf-ink) 14%, transparent); max-width: 300px; }
.rx-tip .tt { font-weight: 700; }
.rx-tip .mu { color: var(--muted); font-size: 11.5px; margin-bottom: 3px; }
.rx-tip .mu2 { color: var(--muted); font-size: 11px; }
.rx-tip .row { display: flex; align-items: center; gap: 6px; }
.rx-tip .row .v { margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.rx-tip .row.tot { border-top: 1px solid var(--line); margin-top: 3px; padding-top: 3px; }
.rx-tip .sw { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto; }

/* tables: every column centered (house rule); a wide one scrolls inside its own box, with a scrollbar that stays visible */
.tablewrap { overflow-x: auto; margin: 6px 0 0; }
.tablewrap::-webkit-scrollbar { height: 9px; }
.tablewrap::-webkit-scrollbar-track { background: var(--line); border-radius: 5px; }
.tablewrap::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 5px; }
.tbl { border-collapse: collapse; font-size: 13.5px; min-width: 100%; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: center; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; line-height: 1.3; }
.tbl .dt { display: block; font-size: 10.5px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.tbl.sticky th:first-child, .tbl.sticky td:first-child { position: sticky; left: 0; z-index: 1; background: var(--mf-bg); }
.tbl tr.pick td { background: var(--soft); font-weight: 600; }
.tbl tr.avg td { font-weight: 700; border-top: 2px solid var(--ink); }
.tbl tr.sec td { text-align: center; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--panel); position: static; }
.tbl td.nm { font-weight: 600; white-space: nowrap; }
/* a readings table: a long indicator name wraps, so the seven columns fit their box at desktop width */
.tbl.readings td.nm { white-space: normal; min-width: 180px; max-width: 320px; line-height: 1.3; }
.tbl td.nw { white-space: nowrap; }
.tbl td.inv { color: var(--mf-bg); }
.tbl td.na { color: var(--muted); font-style: italic; white-space: nowrap; }
.tablecap { font-size: 15px; font-weight: 700; text-align: center; margin: 2px 0 2px; }
.tablesub { font-size: 12px; text-align: center; margin: 0 0 6px; line-height: 1.4; }
.rx-tablesrc { font-size: 10.5px; font-style: italic; color: var(--muted); margin: 8px 0 0; text-align: left; }
.rx-tablesrc a { color: inherit; text-underline-offset: 2px; }
/* a color key: <div class="scale"><span>Low</span><i></i><span>High</span></div>; the script sets the gradient */
.scale { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 11.5px; color: var(--muted); margin: 6px 0; }
.scale i { width: 160px; height: 9px; border-radius: 2px; display: inline-block; border: 1px solid var(--line); }

/* dated text from published reports: each entry opens with the diamond and its date */
.edbox { border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px 4px; margin: 18px 0 0; background: var(--panel); }
.edhead { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; margin: 0 0 6px; }
.edlist { list-style: none; margin: 0; padding: 0; max-width: 940px; }
.edlist li { font-size: 14px; line-height: 1.5; margin: 0 0 8px; padding-left: 22px; position: relative; }
.edlist .dia { position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 700; }
.edlist .eddate { font-weight: 600; white-space: nowrap; }
.edlist .eddate::after { content: ":"; }

/* a quotation and where it comes from (What others say) */
.qcard { border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; margin: 12px 0 0; background: var(--mf-bg); min-width: 0; }
.qcard .who { font-size: 15px; font-weight: 700; line-height: 1.3; }
.qcard .meta { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin: 2px 0 8px; }
.qcard .gist { font-size: 14px; line-height: 1.5; margin: 0 0 8px; }
.qcard blockquote { margin: 8px 0 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--accent); font-size: 14px; line-height: 1.5; }
.qcard blockquote .where { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; font-style: normal; }

/* long text (About) */
.prose p { font-size: 15.5px; line-height: 1.6; margin: 0 0 12px; max-width: 900px; }
.prose ul { margin: 0 0 14px; padding-left: 1.2em; max-width: 900px; }
.prose li { font-size: 15.5px; line-height: 1.55; margin: 0 0 8px; }
.v { white-space: nowrap; }

.foot { border-top: 1px solid var(--line); margin: 48px 0 0; padding-top: 12px; }
.foot p { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 0 0 6px; max-width: 900px; }
.foot a { color: inherit; }

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  h1 { font-size: 27px; }
  /* on a phone a row of buttons becomes an even grid: equal widths, nothing cut off */
  .seg { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; }
  .seg button, .seg.wide button, .seg.xwide button, .seg.narrow button { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); margin-bottom: -1px; }
  .seg button:nth-child(odd) { border-right: 1px solid var(--line); }
  .seg.xwide { grid-template-columns: 1fr; }
  .seg.xwide button:nth-child(odd) { border-right: 0; }
  .seg.narrow { grid-template-columns: repeat(4, 1fr); }
  .seg.narrow button { border-right: 1px solid var(--line); font-size: 12px; padding: 0 2px; }
  .seg.narrow button:last-child { border-right: 0; }
  .ctl { width: 100%; }
  .btn { width: 100%; }
  .chips button, .chips.narrow button { width: calc(50% - 3px); }
  .chips.narrow button { width: calc(25% - 5px); }
}
/* two columns at desktop, one under 720 px */
@media (max-width: 720px) {
  .cards, .pair { grid-template-columns: 1fr; }
  .tbl td.nm { white-space: normal; min-width: 124px; max-width: 170px; }
}
