/* Interactive guides (2026-11-05): the panels, pill switch, sliders, read-outs, line charts, bar rows
   and step lists in the News guides, drawn by /finance/explore.js. Ported from the blog's
   /assets/blog/explore.css to the finance look: finance tokens only, the suite's corner radius,
   and sizes that sit in the 760 px guide column. Colour carries the data: ink for the main line,
   then ochre, red, green and a slate blue, each chosen to read on Clay in light and on night in dark.
   Loads after /finance/guides.css. */

[data-look="finance"] {
  --x-1: var(--ink); --x-2: #7A5410; --x-3: #8E2A17; --x-4: #2F5E3F; --x-5: #34507A;
  --x-1-bg: color-mix(in srgb, var(--ink) 10%, transparent);
  --x-2-bg: rgba(122,84,16,0.14); --x-3-bg: rgba(142,42,23,0.13); --x-4-bg: rgba(47,94,63,0.14); --x-5-bg: rgba(52,80,122,0.14);
}
[data-look="finance"][data-theme="dark"], [data-theme="dark"] [data-look="finance"] {
  --x-2: #C8974A; --x-3: #E07070; --x-4: #8FA89E; --x-5: #A9BDE0;
  --x-2-bg: rgba(200,151,74,0.16); --x-3-bg: rgba(224,112,112,0.15); --x-4-bg: rgba(143,168,158,0.16); --x-5-bg: rgba(169,189,224,0.16);
}

/* ── Panel: a rounded block on the surface, the homepage frame without a picture. Holds a
   question, its controls and the answer. .x-panel--deep sits one step darker. ── */
.x-panel { position: relative; margin: 2.25rem 0; padding: 28px 28px 24px; border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.x-panel--deep { background: var(--surface-2); }
.x-panel__k { margin-bottom: 8px; color: var(--muted); font-size: 15px; line-height: 20px; }
.x-panel__q { max-width: 24em; font-size: 22px; line-height: 1.2; letter-spacing: -0.015em; text-wrap: balance; }
.x-panel__note { margin-top: 20px; max-width: 40em; color: var(--muted); font-size: var(--t-caption); line-height: 18px; letter-spacing: var(--tr-caption); text-wrap: pretty; }
.x-panel__note a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.x-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; margin-top: 32px; }
.x-control { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.x-control__k { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--muted); font-size: 15px; line-height: 20px; }
.x-control__v { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── The pill switch from the homepage's Map control. ── */
.x-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border: 1px solid var(--muted); border-radius: 999px; align-self: flex-start; }
.x-seg button { padding: 5px 14px; border-radius: 999px; color: var(--muted); font-size: 15px; line-height: 20px; transition: background-color .2s, color .2s; }
.x-seg button:hover { color: var(--ink); }
.x-seg button[aria-checked="true"] { background: var(--ink); color: var(--bg); }
.x-panel .x-seg button[aria-checked="true"] { color: var(--surface); }
.x-panel--deep .x-seg button[aria-checked="true"] { color: var(--surface-2); }

/* ── Slider: a hairline track that fills in ink up to the thumb (--fill is set by explore.js). ── */
.x-range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; --fill: 50%; }
.x-range::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(to right, var(--ink) var(--fill), var(--line) var(--fill)); }
.x-range::-moz-range-track { height: 3px; border-radius: 2px; background: var(--line); }
.x-range::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--ink); }
.x-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9.5px; border-radius: 50%; background: var(--ink); border: 4px solid var(--surface); box-shadow: 0 0 0 1px var(--ink); transition: transform .15s var(--ease); }
.x-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 4px solid var(--surface); box-shadow: 0 0 0 1px var(--ink); }
.x-range:active::-webkit-slider-thumb { transform: scale(1.12); }
.x-panel--deep .x-range::-webkit-slider-thumb { border-color: var(--surface-2); }
.x-panel--deep .x-range::-moz-range-thumb { border-color: var(--surface-2); }
.x-range:focus-visible { outline: none; }
.x-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--ink), 0 0 0 4px var(--accent); }
.x-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 1px var(--ink), 0 0 0 4px var(--accent); }
.x-input { width: 100%; padding: 8px 0 6px; border: 0; border-bottom: 1px solid var(--muted); background: transparent; color: var(--ink); font: inherit; font-size: var(--t-body); font-variant-numeric: tabular-nums; }
.x-input:focus { outline: none; border-bottom-color: var(--ink); }

/* ── Read-outs: big figures in a row on a hairline. ── */
.x-outs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px 24px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }
.x-out__k { color: var(--muted); font-size: var(--t-caption); line-height: 18px; letter-spacing: var(--tr-caption); }
.x-out__v { margin-top: 6px; font-size: clamp(34px, 26px + 1.6vw, 48px); line-height: 1; letter-spacing: -0.035em; font-weight: 300; font-variant-numeric: tabular-nums; white-space: nowrap; }
.x-out__v small { margin-left: 6px; color: var(--muted); font-size: 15px; line-height: 20px; letter-spacing: 0; font-weight: 400; }
.x-out__s { margin-top: 8px; color: var(--muted); font-size: 15px; line-height: 20px; text-wrap: pretty; }
.x-out--2 .x-out__v { color: var(--x-2); } .x-out--3 .x-out__v { color: var(--x-3); } .x-out--4 .x-out__v { color: var(--x-4); } .x-out--5 .x-out__v { color: var(--x-5); }
.x-verdict { margin-top: 24px; max-width: 36em; font-size: 17px; line-height: 1.6; text-wrap: pretty; }

/* ── Line chart (explore.js draws the SVG; colours come from here, so a theme switch needs no redraw). ── */
.x-chart { position: relative; margin-top: 32px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.x-chart svg { display: block; width: 100%; overflow: visible; }
.x-chart .grid line { stroke: var(--line); stroke-width: 1; }
.x-chart .axis text { fill: var(--muted); font-size: 12px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.x-chart .ser { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.x-chart .area { stroke: none; }
.x-chart .mark line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 4; }
.x-chart .mark text { fill: var(--muted); font-size: 12px; font-family: var(--sans); }
.x-chart .band { fill: var(--x-1-bg); }
.x-chart .hover line { stroke: var(--ink); stroke-width: 1; }
.x-chart .hover circle { stroke: var(--surface); stroke-width: 2.5; }
.x-panel--deep .x-chart .hover circle { stroke: var(--surface-2); }
.x-chart .end text { font-size: 12px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.c-1 { stroke: var(--x-1); fill: var(--x-1); color: var(--x-1); } .c-2 { stroke: var(--x-2); fill: var(--x-2); color: var(--x-2); }
.c-3 { stroke: var(--x-3); fill: var(--x-3); color: var(--x-3); } .c-4 { stroke: var(--x-4); fill: var(--x-4); color: var(--x-4); }
.c-5 { stroke: var(--x-5); fill: var(--x-5); color: var(--x-5); }
.x-chart .area.c-1 { fill: var(--x-1-bg); } .x-chart .area.c-2 { fill: var(--x-2-bg); } .x-chart .area.c-3 { fill: var(--x-3-bg); } .x-chart .area.c-4 { fill: var(--x-4-bg); } .x-chart .area.c-5 { fill: var(--x-5-bg); }
.x-chart .ser.dash { stroke-dasharray: 5 5; }
.x-chart .ser.faint { opacity: .28; stroke-width: 1.5; }
.x-tip { position: absolute; top: 0; z-index: 2; min-width: 150px; padding: 10px 12px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: var(--t-caption); line-height: 18px; pointer-events: none; opacity: 0; transition: opacity .15s; font-variant-numeric: tabular-nums; }
.x-tip.on { opacity: 1; }
.x-tip b { display: block; margin-bottom: 4px; font-weight: 500; }
.x-tip span { display: flex; justify-content: space-between; gap: 16px; }
.x-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 16px; color: var(--muted); font-size: var(--t-caption); line-height: 18px; letter-spacing: var(--tr-caption); }
.x-legend span { display: inline-flex; align-items: center; gap: 8px; }
.x-legend i { width: 16px; height: 3px; border-radius: 2px; background: currentColor; }
.x-legend i.dash { background: repeating-linear-gradient(90deg, currentColor 0 5px, transparent 5px 9px); }
.x-legend span > em { font-style: normal; color: var(--muted); }

/* ── Bar rows: a label, a track and a figure; a row can be split into coloured parts. ── */
.x-bars { display: flex; flex-direction: column; gap: 14px; margin-top: 32px; }
.x-bar { display: grid; grid-template-columns: minmax(96px, 11em) minmax(0, 1fr) minmax(5.5em, auto); align-items: center; column-gap: 16px; }
.x-bar__k { color: var(--ink); font-size: 15px; line-height: 20px; }
.x-bar__k small { display: block; color: var(--muted); font-size: var(--t-caption); line-height: 18px; }
.x-bar__t { position: relative; display: flex; height: 22px; border-radius: 6px; background: var(--x-1-bg); overflow: hidden; }
.x-bar__p { height: 100%; width: 0; background: currentColor; transition: width .9s var(--ease); }
.x-bar__p + .x-bar__p { box-shadow: inset 2px 0 0 var(--surface); }
.x-panel--deep .x-bar__p + .x-bar__p { box-shadow: inset 2px 0 0 var(--surface-2); }
.x-bar__v { color: var(--ink); font-size: 15px; line-height: 20px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.x-bar.is-you .x-bar__k { font-weight: 500; }

/* ── Guess first: drag to your guess, then the answer slides in beside it. ── */
.x-guess__row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 28px; }
.x-guess__row .x-control { flex: 1 1 260px; }
.x-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 15px; line-height: 20px; transition: opacity .2s; }
.x-btn:hover { opacity: .86; }
.x-btn[disabled] { opacity: .35; cursor: default; }
.x-btn--quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--muted); }
.x-guess__scale { position: relative; height: 56px; margin: 4px 11px 16px; border-top: 1px solid var(--line); }
.x-guess__pin { position: absolute; top: -1px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 0; transition: left .9s var(--ease), opacity .3s; font-size: var(--t-caption); line-height: 18px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.x-guess__pin::before { content: ''; width: 2px; height: 18px; background: currentColor; }
.x-guess__pin--you { color: var(--muted); }
.x-guess__pin--real { color: var(--x-3); font-weight: 500; opacity: 0; }
.x-guess.is-revealed .x-guess__pin--real { opacity: 1; }
.x-guess__after { margin-top: 20px; max-width: 36em; opacity: 0; transition: opacity .5s var(--ease) .5s; }
.x-guess.is-revealed .x-guess__after { opacity: 1; }

/* ── Step list: a numbered sequence on hairlines, one step lit at a time. ── */
.x-steps { list-style: none; margin: 32px 0 0; padding: 0; counter-reset: s; }
.x-steps li { display: grid; grid-template-columns: 3em minmax(0, 1fr) auto; column-gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); counter-increment: s; color: var(--muted); transition: color .3s var(--ease); cursor: pointer; }
.x-steps li::before { content: counter(s, decimal-leading-zero); font-size: 15px; line-height: 20px; font-variant-numeric: tabular-nums; }
.x-steps li b { display: block; color: var(--ink); font-weight: 500; font-size: 17px; line-height: 1.5; }
.x-steps li p { grid-column: 2 / -1; display: none; margin-top: 6px; max-width: 34em; font-size: 15px; line-height: 22px; color: var(--ink); }
.x-steps li .x-steps__t { color: var(--muted); font-size: 15px; line-height: 20px; white-space: nowrap; text-align: right; }
.x-steps li[aria-expanded="true"] p { display: block; }
.x-steps li[aria-expanded="true"]::before { color: var(--ink); }
.x-steps li:focus-visible { outline-offset: 2px; }

/* ── Sources: a quiet numbered list at the end. ── */
.x-sources { margin-top: 3rem; padding-top: 20px; border-top: 1px solid var(--line); }
.x-sources h2 { margin-bottom: 16px; color: var(--muted); font-size: 15px; line-height: 20px; font-weight: 400; }
.x-sources ol { margin: 0; padding-left: 1.4em; max-width: 46em; color: var(--muted); font-size: var(--t-caption); line-height: 18px; letter-spacing: var(--tr-caption); }
.x-sources li + li { margin-top: 6px; }
.x-sources a { color: inherit; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }


@media (max-width: 860px) {
  .x-panel { padding: 24px 18px 20px; margin-left: -6px; margin-right: -6px; }
  .x-controls { grid-template-columns: 1fr; }
  .x-bar { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .x-bar__t { grid-column: 1 / -1; grid-row: 2; }
  /* 40 px buttons as drawn, a 44 px hit area, as on the homepage */
  .x-seg button { position: relative; min-height: 40px; padding: 0 16px; }
  .x-seg button::after { content: ''; position: absolute; inset: -2px 0; }
  .x-steps li { grid-template-columns: 2.4em minmax(0, 1fr); }
  .x-steps li .x-steps__t { grid-column: 2; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .x-seg button, .x-bar__p, .x-guess__pin, .x-guess__after, .x-steps li, .x-range::-webkit-slider-thumb { transition: none; }
}

/* ── Facts: a short list of figures on hairlines, in two columns where there is room. ── */
.x-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; margin: 1.5rem 0 2rem; padding: 0; }
.x-facts > div { padding: 10px 0; border-top: 1px solid var(--line); }
.x-facts dt { color: var(--muted); font-size: var(--t-caption); line-height: 18px; letter-spacing: var(--tr-caption); }
.x-facts dd { margin: 2px 0 0; color: var(--ink); font-size: 16px; line-height: 22px; font-variant-numeric: tabular-nums; }
.x-facts-title { margin-top: 2rem; color: var(--muted); font-size: 15px; line-height: 20px; }
.guide-prose .x-steps, .guide-prose .x-sources ol { margin-left: 0; }
.guide-prose .x-panel p { margin-bottom: 0; }
.x-pane[hidden] { display: none; }
.x-pane ul { margin: 20px 0 0; padding-left: 1.2em; }
.x-pane li { font-size: 16.5px; line-height: 1.6; }
.x-pane li + li { margin-top: 0.6em; }
@media (max-width: 600px) { .x-facts { grid-template-columns: 1fr; } }
/* Phones: a switch that wraps rounds as a box, and its buttons share out each row. */
@media (max-width: 600px) { .x-seg { border-radius: 23px; } .x-seg button { flex: 1 1 auto; } }
