/* Article "How central banks work" (/articles/central-banks-and-interest-rates/).
   Hikes and higher rates in blue (--s1), cuts and lower rates in orange (--s2), as in
   the Fed article; below-zero rates in the loss red (--bad), deeper is darker. */

/* ---- the chain: five stages, cards with live numbers ---- */
.cb-chain-fig { padding-top: 18px; }
.cb-chain-box { position: relative; }
.cb-chain { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr 2fr 1fr 1.6fr; gap: 12px; counter-reset: none; }
.cb-stage { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cb-stage + .cb-stage::before { content: "→"; position: absolute; left: -12px; top: 2px; width: 12px; text-align: center; color: var(--muted); font: 600 14px/1 var(--font); }
.cb-stage-h { display: flex; align-items: baseline; gap: 8px; min-height: 36px; }
.cb-n { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--solid); color: #fff; font: 700 11px/1 var(--font); transform: translateY(-1px); }
.cb-stage-t { font: 650 13.5px/1.3 var(--font); color: var(--ink); }
.cb-wide > .cb-m { }
.cb-stage.cb-wide { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: auto; align-content: start; }
.cb-stage.cb-wide > .cb-stage-h { grid-column: 1 / -1; }
.cb-m { display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 10px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.cb-m-top { display: flex; flex-direction: column; gap: 2px; }
.cb-m-label { font-size: 12px; line-height: 1.3; color: var(--muted); }
.cb-m-now { font: 650 22px/1.1 var(--mono); color: var(--ink); letter-spacing: -0.02em; }
.cb-spark { display: block; width: 100%; height: 36px; overflow: visible; cursor: crosshair; touch-action: pan-y; }
.cb-sp-cyc { fill: var(--s1); fill-opacity: 0.13; }
.cb-sp-ln { fill: none; stroke: var(--s1); stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.cb-m[data-k="hs"] .cb-sp-ln, .cb-m[data-k="un"] .cb-sp-ln, .cb-m[data-k="inf"] .cb-sp-ln { stroke: var(--ink-2); }
.cb-sp-cur { stroke: var(--ink); stroke-opacity: 0.5; stroke-width: 1; vector-effect: non-scaling-stroke; }
.cb-m-line { margin: 0; font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.cb-m-when { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
@media (max-width: 1100px) {
  .cb-chain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cb-stage.cb-wide { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cb-stage:nth-child(5) { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .cb-stage:nth-child(5) > .cb-stage-h { grid-column: 1 / -1; }
  .cb-stage + .cb-stage::before { display: none; }
}
@media (max-width: 720px) {
  .cb-stage.cb-wide { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .cb-chain { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .cb-stage.cb-wide, .cb-stage:nth-child(5) { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cb-stage-h { min-height: 0; }
  .cb-m { padding: 10px; }
  .cb-m-now { font-size: 19px; }
}

/* ---- the lags: small multiples ---- */
.cb-plot-lag { min-height: 380px; }
.cb-lag-panel { fill: var(--surface-2); stroke: var(--border); stroke-width: 1; }
.cb-lag-title { fill: var(--ink); font: 650 12px/1 var(--font); }
.cb-lag-zero { stroke: var(--axis); stroke-width: 1; }
.cb-lag-start { stroke: var(--ink); stroke-opacity: 0.35; stroke-width: 1; }
.cb-lag-turn { stroke: var(--ink); stroke-opacity: 0.55; stroke-width: 1.2; stroke-dasharray: 3 3; }
.cb-lag-cur { stroke: var(--ink); stroke-opacity: 0.5; stroke-width: 1; }
.cb-lag-ln { fill: none; stroke: var(--line-gray); stroke-opacity: 0.45; stroke-width: 1.1; stroke-linejoin: round; }
.cb-lag-med { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.cb-lag-last { fill: none; stroke: var(--s1); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.ln.cb-cyc { stroke: var(--line-gray); stroke-opacity: 0.7; stroke-width: 1.4; }
.ln.cb-med { stroke: var(--ink); stroke-width: 2.6; }
.ln.cb-last { stroke: var(--s1); stroke-width: 2.4; }
.cb-lag-table td, .cb-lag-table th { white-space: nowrap; }
.cb-lag-sum-v { fill: var(--ink); font: 650 18px/1 var(--mono); }
.cb-lag-sum-t { fill: var(--ink-2); font: 500 11.5px/1 var(--font); }
.cb-lag-sum-t.m { fill: var(--muted); font-size: 10.5px; }
.cb-med-row > * { font-weight: 650; background: var(--surface-2); }

/* ---- the world: ranked dot strip ---- */
.cb-plot-world { min-height: 600px; }
.cb-w-on { fill: var(--track); fill-opacity: 0.7; }
.cb-w-name { fill: var(--ink-2); font: 500 12px/1 var(--font); }
.cb-w-name.us { fill: var(--ink); font-weight: 700; }
.cb-w-track { stroke: var(--grid); stroke-width: 1; }
.cb-w-zero { stroke: var(--axis); stroke-width: 1; }
.cb-w-ln { stroke-width: 3; stroke-linecap: round; stroke-opacity: 0.55; }
.cb-w-ln.up { stroke: var(--s1); }
.cb-w-ln.dn { stroke: var(--s2); }
.cb-w-ya { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.4; }
.cb-w-now { stroke: var(--surface); stroke-width: 1.5; }
.cb-w-now.up { fill: var(--s1); }
.cb-w-now.dn { fill: var(--s2); }
.cb-w-now.eq { fill: var(--line-gray); }
.cb-w-v { fill: var(--ink); font: 600 11px/1 var(--mono); }
.cb-w-v.brk { font-weight: 700; }
.cb-w-brk { fill: var(--muted); font: 700 12px/1 var(--font); }
.sw-sq.cb-same { background: var(--line-gray); }
.cb-world-table .cb-k { color: var(--muted); width: 2.2em; text-align: left; }

/* ---- the wave: month-by-month grid ---- */
.cb-plot-wave { min-height: 560px; }
.cb-wv-win { fill: var(--s1); fill-opacity: 0.06; }
.cb-wv-wl { fill: var(--muted); font: 600 10.5px/1 var(--font); }
.cb-wv-lab { font: 600 11px/1 var(--font); }
.cb-wv-lab.up { fill: var(--s1); }
.cb-wv-lab.dn { fill: var(--s2); }
.cb-wv-bar.up { fill: var(--s1); fill-opacity: 0.85; }
.cb-wv-bar.dn { fill: var(--s2); fill-opacity: 0.85; }
.cb-wv-bar.on { fill-opacity: 1; }
.cb-wv-base { stroke: var(--axis); stroke-width: 1; }
.cb-wv-n { fill: var(--muted); font: 500 10px/1 var(--mono); }
.cb-wv-name { fill: var(--ink-2); font: 500 11px/1 var(--font); }
.cb-wv-name.s { font: 500 9px/1 var(--mono); }
.cb-wv-c { shape-rendering: crispEdges; }
.cb-wv-c.hold { fill: var(--track); }
.cb-wv-c.up { fill: var(--s1); }
.cb-wv-c.dn { fill: var(--s2); }
.cb-wv-sel { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.cb-wv-yr { stroke: var(--surface); stroke-width: 1.5; }
.sw-sq.cb-hold { background: var(--track); box-shadow: inset 0 0 0 1px var(--border); }

/* ---- the negative-rate club ---- */
.cb-plot-neg { min-height: 230px; }
.cb-ng-cnt { fill: var(--bad); fill-opacity: 0.55; }
.cb-ng-cnt.on { fill-opacity: 0.9; }
.cb-ng-track { fill: var(--track); fill-opacity: 0.6; }
.cb-ng-c { shape-rendering: crispEdges; }
.cb-ng-c.n1, .sw-sq.cb-n1 { fill: color-mix(in srgb, var(--bad) 35%, var(--surface)); background: color-mix(in srgb, var(--bad) 35%, var(--surface)); }
.cb-ng-c.n2, .sw-sq.cb-n2 { fill: color-mix(in srgb, var(--bad) 62%, var(--surface)); background: color-mix(in srgb, var(--bad) 62%, var(--surface)); }
.cb-ng-c.n3, .sw-sq.cb-n3 { fill: var(--bad); background: var(--bad); }

/* ---- targets: one card per central bank ---- */
.cb-tgt-fig { padding-top: 14px; }
.cb-targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; margin-top: 6px; }
.cb-t { display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 14px; box-shadow: none; border: 1px solid var(--border); background: var(--surface-2); }
.cb-t-head { display: flex; flex-direction: column; gap: 2px; }
.cb-t-bank { font: 650 14px/1.25 var(--font); color: var(--ink); }
.cb-t-where { font-size: 12px; color: var(--muted); }
.cb-t-target { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.cb-t-target .mid { font-size: 28px; }
.cb-t-measure { font-size: 12px; color: var(--ink-2); line-height: 1.35; }
.cb-gauge { position: relative; height: 34px; margin: 2px 4px 0; }
.cb-g-track { position: absolute; left: 0; right: 0; top: 9px; height: 6px; border-radius: 3px; background: var(--track); }
.cb-g-band { position: absolute; top: 6px; height: 12px; border-radius: 4px; background: var(--good); opacity: 0.35; min-width: 3px; transform: translateX(0); }
.cb-g-infl { position: absolute; top: 5px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--ink); border: 2px solid var(--surface); box-sizing: border-box; }
.cb-g-infl.off { background: var(--bad); }
.cb-g-infl.on { background: var(--good); }
.cb-g-rate { position: absolute; top: 2px; width: 3px; height: 20px; margin-left: -1.5px; border-radius: 2px; background: var(--s1); }
.cb-g-ax { position: absolute; top: 22px; font: 500 10px/1 var(--mono); color: var(--muted); }
.cb-g-0 { left: 0; }
.cb-g-hi { right: 0; }
.sw-sq.cb-band { background: var(--good); opacity: 0.45; }
.sw-sq.cb-infl { background: var(--ink); border-radius: 50%; }
.sw-sq.cb-rate { background: var(--s1); width: 4px; border-radius: 2px; }
.cb-t-dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.cb-t-dl div { min-width: 0; }
.cb-t-dl dt { font-size: 11.5px; color: var(--muted); }
.cb-t-dl dd { margin: 2px 0 0; font: 650 16px/1.2 var(--mono); color: var(--ink); }
.cb-t-vs { display: block; margin-top: 2px; font: 500 11.5px/1.3 var(--font); color: var(--ink-2); }
.cb-t-q { margin: auto 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.cb-t-q a { color: var(--accent-ink); }

@media (max-width: 560px) {
  .cb-plot-world { min-height: 520px; }
  .cb-plot-wave { min-height: 420px; }
  .cb-t-target .mid { font-size: 24px; }
}
