/* ═══════════════════════════════════════════════════════
   21VOX FREE TOOLS: "The Instrument"
   Shared layout and components for every free tool (Calculator and Readout variants).
   Loaded after styles.css. Behaviour: js/tool-ui.js. Charts: js/tool-chart-theme.js.
   ═══════════════════════════════════════════════════════ */

:root {
    --tl-text: #f2efe9;
    --tl-body: #d9d3c9;
    --tl-soft: #e6e0d6;
    --tl-quiet: #cfc9bf;
    --tl-muted: #a8a196;
    --tl-dim: #8a8378;
    --tl-card: #0f0e0d;
    --tl-card-2: #151413;
    --tl-line: #262420;
    --tl-outline: #3a3732;
    --tl-chip-line: #34312c;
    --tl-field: #0b0a09;
    --tl-track: #1c1a17;
    --tl-warm: #120d07;
    --tl-warm-line: #3a2a14;
    --tl-answer-line: #6b4a1e;
    --tl-ink: #140c02;
    --tl-up: #3ecf8e;
    --tl-down: #f2766b;
    /* Series palette (js/tool-chart-theme.js uses the same values) */
    --tl-btc: #f7931a;
    --tl-gold: #cfc6a8;   /* pale stone: #e3c35a read as the same colour as Bitcoin's orange */
    --tl-sp: #8fa8ff;
    --tl-hysa: #7fb3c8;
    --tl-base: #4a4640;
}

/* Georgia sized to DM Serif Display's width, so headings barely reflow when the web font arrives */
@font-face { font-family: 'DM Serif Fallback'; src: local('Georgia'); size-adjust: 97%; }
.tl { --serif: 'DM Serif Display', 'DM Serif Fallback', Georgia, serif; color: var(--tl-text); font-family: var(--sans); font-size: 17px; line-height: 1.55; }

/* The input panel and the phone headline are sticky, which needs a body that clips instead of scrolling */
body { overflow-x: clip; }
site-header > header { position: relative; }
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

.tl-wrap { max-width: 1304px; margin: 0 auto; padding: 36px 32px 0; }
.tl-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.tl a:focus-visible, .tl button:focus-visible, .tl input:focus-visible, .tl select:focus-visible, .tl summary:focus-visible, .tl [tabindex]:focus-visible,
.tl input:focus-visible + .tl-switch-ui { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
.tl [id] { scroll-margin-top: 80px; }
.tl strong { font-weight: 700; color: var(--tl-text); }
.tl [hidden] { display: none !important; }
.tl .up { color: var(--tl-up); }
.tl .dn { color: var(--tl-down); }
/* styles.css styles every <header> as the site bar and every nav link as a header link */
.tl-head { position: static; z-index: auto; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0; transform: none; transition: none; }
.tl nav a { font-family: inherit; font-size: inherit; font-weight: inherit; letter-spacing: normal; text-transform: none; white-space: normal; }

/* Mono labels used across the tool */
.tl-k { margin: 0; font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange); }
.tl-k--muted { font-size: 10px; color: var(--tl-muted); }
h2.tl-k, h3.tl-k { font-size: 11px; line-height: 1.4; }

/* ── 1. Tool head ── */
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.tl-head > div { min-width: 0; }
.tl-eyebrow { margin: 0 0 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange); }
.tl-head h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 56px; line-height: 1; color: var(--tl-text); overflow-wrap: break-word; }
.tl-head h1 em { color: var(--orange); }
.tl-desc { max-width: 56ch; margin: 12px 0 0; font-size: 18px; line-height: 1.5; color: var(--tl-quiet); }
.tl-desc a { color: inherit; text-decoration: underline; text-decoration-color: rgba(247, 147, 26, 0.5); text-underline-offset: 3px; }
.tl-live { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px; border: 1px solid var(--tl-line); border-radius: 999px; font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; color: var(--tl-quiet); white-space: nowrap; }
.tl-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tl-dim); }
.tl-live.is-live .tl-live-dot { background: var(--tl-up); }

/* ── Layout ── */
.tl-grid { display: grid; grid-template-columns: minmax(280px, 320px) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 28px; }
.tl-results { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.tl--readout .tl-grid { grid-template-columns: minmax(0, 1fr); }

/* ── 2. Input panel ── */
.tl-panel { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 22px; padding: 22px; background: var(--tl-card); border: 1px solid var(--tl-line); border-radius: 16px; }
.tl-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.tl-label { margin: 0; padding: 0; font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tl-muted); }
.tl-hint { margin: 0; font-size: 13px; line-height: 1.45; color: var(--tl-muted); }
.tl-panel-note { margin: 0; font-size: 13px; color: var(--tl-muted); }

/* Number field with a $ or ₿ prefix */
.tl-num { display: flex; align-items: center; min-height: 50px; padding: 0 14px; background: var(--tl-field); border: 1px solid var(--tl-outline); border-radius: 10px; cursor: text; }
.tl-num:focus-within { border-color: var(--orange); }
.tl-num-pre, .tl-num-post { flex: none; font-size: 20px; font-weight: 600; color: var(--tl-muted); }
.tl-num-pre { margin-right: 6px; }
.tl-num-post { margin-left: 6px; font-size: 15px; font-weight: 500; }
.tl-num input { flex: 1; width: 100%; min-width: 0; height: 48px; padding: 0; background: transparent; border: 0; outline: 0; color: var(--tl-text); font-family: var(--sans); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tl-num input:focus-visible { outline: 0; }
.tl-num:has(input:focus-visible) { outline: 2px solid var(--orange); outline-offset: 2px; }
.tl-range { width: 100%; margin: 4px 0 0; accent-color: var(--orange); }

/* Preset chips and segmented choices: buttons with aria-pressed */
.tl-chips, .tl-seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tl-chip-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--tl-chip-line); border-radius: 8px; background: transparent; color: var(--tl-soft); font-family: var(--sans); font-size: 14px; font-weight: 600; line-height: 1.2; cursor: pointer; transition: background-color 0.12s, border-color 0.12s, color 0.12s; }
.tl-chip-btn:hover { border-color: var(--tl-outline); color: var(--tl-text); }
.tl-chip-btn[aria-pressed="true"] { border-color: var(--orange); background: var(--orange); color: var(--tl-ink); }

/* Select */
.tl-select { position: relative; display: block; }
.tl-select select { -webkit-appearance: none; appearance: none; width: 100%; min-height: 50px; padding: 0 40px 0 14px; background: var(--tl-field); border: 1px solid var(--tl-outline); border-radius: 10px; color: var(--tl-text); font-family: var(--sans); font-size: 17px; font-weight: 600; cursor: pointer; }
.tl-select select:focus { border-color: var(--orange); }
.tl-select::after { content: ""; position: absolute; top: 50%; right: 16px; width: 0; height: 0; margin-top: -2px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--tl-muted); pointer-events: none; }
.tl-select select option { background: var(--tl-card); color: var(--tl-text); }
.tl-pair-selects { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; }

/* Toggle switch: a real checkbox with role="switch" */
.tl-switch { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-size: 14px; color: var(--tl-soft); cursor: pointer; }
.tl-switch input { position: absolute; right: 0; top: 50%; width: 34px; height: 20px; margin: -10px 0 0; opacity: 0; cursor: pointer; }
.tl-switch-l { display: inline-flex; align-items: center; gap: 8px; }
.tl-key { flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--k, var(--tl-muted)); }
.tl-switch-ui { position: relative; flex: none; width: 34px; height: 20px; border-radius: 999px; background: var(--tl-outline); transition: background-color 0.12s; pointer-events: none; }
.tl-switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--tl-text); transition: transform 0.12s; }
.tl-switch input:checked + .tl-switch-ui { background: var(--orange); }
.tl-switch input:checked + .tl-switch-ui::after { transform: translateX(14px); background: var(--tl-ink); }

/* ── 3. Answer card ── */
.tl-answer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: center; padding: 28px 30px; background: var(--tl-warm); border: 1px solid var(--tl-answer-line); border-radius: 18px; }
.tl-answer--solo { grid-template-columns: minmax(0, 1fr); }
.tl-big { margin: 6px 0 0; font-family: var(--serif); font-weight: 400; font-size: 76px; line-height: 0.95; font-variant-numeric: tabular-nums; color: var(--tl-text); overflow-wrap: anywhere; }
.tl-big small { font-size: 0.45em; color: var(--tl-quiet); }
.tl-context { margin: 10px 0 0; font-size: 17px; line-height: 1.5; color: var(--tl-soft); }
.tl-chips-out { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.tl-chip { display: inline-flex; align-items: center; padding: 4px 9px; border: 1px solid var(--tl-warm-line); border-radius: 6px; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--tl-soft); }
.tl-chip--hot { border-color: var(--orange); background: var(--orange); color: var(--tl-ink); font-weight: 500; }
.tl-chip--down { border-color: var(--tl-down); background: transparent; color: var(--tl-down); }
.tl-answer-side > .tl-k { margin-bottom: 8px; }

/* ── 4. Comparison bars ── */
.tl-bars { display: flex; flex-direction: column; }
.tl-bar { display: grid; grid-template-columns: minmax(0, 190px) minmax(40px, 1fr) minmax(76px, auto); gap: 12px; align-items: center; padding: 7px 0; }
.tl-bar-l { font-size: 15px; line-height: 1.35; color: var(--tl-quiet); }
.tl-bar-track { height: 14px; border-radius: 3px; background: var(--tl-track); overflow: hidden; }
.tl-bar-fill { display: block; height: 100%; border-radius: 3px; background: var(--c, var(--orange)); transition: width 0.15s ease; }
.tl-bar-v { text-align: right; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--tl-text); white-space: nowrap; }
.tl-bar-d { display: block; font-size: 11px; font-weight: 400; color: var(--tl-muted); }
.tl-bar--base .tl-bar-l { color: var(--tl-muted); }

/* ── Phone headline: a slim copy of the answer that stays pinned while the inputs scroll ── */
.tl-pin { display: none; }

/* ── 5. Chart frame ── */
.tl-chart { margin: 0; padding: 18px 20px; background: var(--tl-card); border: 1px solid var(--tl-line); border-radius: 16px; }
.tl-chart figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; margin-bottom: 12px; }
.tl-chart-t { font-size: 17px; font-weight: 700; color: var(--tl-text); }
.tl-chart-sub { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--tl-muted); }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--tl-muted); }
.tl-legend li { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend .tl-key { width: 9px; height: 9px; }
.tl-legend .tl-key--line { width: 14px; height: 0; border-top: 2px dashed var(--k); border-radius: 0; background: none; }
.tl-chart-box { position: relative; height: 320px; }
.tl-chart-box canvas { display: block; width: 100% !important; height: 100% !important; }
.tl-chart-note { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--tl-muted); }
.tl-chart-note[hidden] { display: none; }

/* ── 6. Story card ── */
.tl-story { padding: 20px 22px; border: 1px solid var(--tl-line); border-radius: 16px; }
.tl-story .tl-k { margin-bottom: 8px; }
.tl-story p:not(.tl-k) { margin: 0; font-size: 17px; line-height: 1.65; color: var(--tl-soft); }
.tl-story p + p:not(.tl-k) { margin-top: 10px; }

/* ── 7. Details accordion and 8. share row ── */
.tl-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.tl-details { padding: 6px 20px; border: 1px solid var(--tl-line); border-radius: 16px; }
.tl-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; font-weight: 700; color: var(--tl-text); list-style: none; cursor: pointer; }
.tl-details > summary::-webkit-details-marker { display: none; }
.tl-mark::before { content: "+"; font-size: 18px; color: var(--orange); }
details[open] > summary .tl-mark::before { content: "\2212"; }
.tl-rows { margin: 0 0 8px; padding: 0; }
.tl-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--tl-line); font-size: 15px; }
.tl-row dt { color: var(--tl-muted); }
.tl-row dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--tl-text); }
.tl-share { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--tl-card); border: 1px solid var(--tl-line); border-radius: 16px; }
.tl-share-t { margin: 0; font-weight: 700; color: var(--tl-text); }
.tl-share-d { margin: 0; font-size: 14px; line-height: 1.5; color: var(--tl-muted); }
.tl-share-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tl-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--tl-outline); border-radius: 10px; background: transparent; color: var(--tl-text); font-family: var(--sans); font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.tl-btn:hover { border-color: var(--orange); color: var(--tl-text); }
.tl-btn--fill { border-color: var(--orange); background: var(--orange); color: var(--tl-ink); }
.tl-btn--fill:hover { background: #ffa53d; color: var(--tl-ink); }
.tl-share-status { min-height: 1.4em; margin: 0; font-size: 13px; color: var(--tl-up); }

/* ── 9. Disclaimer note ── */
.tl-note { margin: 0; font-size: 12px; line-height: 1.55; color: var(--tl-dim); }
.tl-note strong { font-weight: 600; color: var(--tl-muted); }
.tl-note a { color: var(--tl-muted); text-decoration: underline; text-underline-offset: 2px; }
.tl-note a:hover { color: var(--orange); }

/* ── Readout extras: plain panels and fields inside or under the answer ── */
.tl-card { padding: 20px 22px; background: var(--tl-card); border: 1px solid var(--tl-line); border-radius: 16px; }
.tl-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 22px; }
.tl-controls > .tl-group { flex: 1 1 220px; }
.tl-field-input { width: 100%; min-height: 50px; padding: 0 14px; background: var(--tl-field); border: 1px solid var(--tl-outline); border-radius: 10px; color: var(--tl-text); font-family: var(--sans); font-size: 17px; }
.tl-field-input:focus { border-color: var(--orange); }
.tl-table-wrap { overflow-x: auto; }
.tl-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.4; }
.tl-table th, .tl-table td { padding: 10px 12px 10px 0; border-top: 1px solid var(--tl-line); text-align: left; vertical-align: top; }
.tl-table thead th { border-top: 0; font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tl-muted); }
.tl-table td { font-variant-numeric: tabular-nums; color: var(--tl-quiet); }
.tl-table tbody th { font-weight: 600; color: var(--tl-text); }

/* ── 10. Below the tool: the guide's reading column ── */
.tl-read { max-width: 760px; margin: 64px auto 0; padding: 0 0 56px; }
.tl-read > :first-child { margin-top: 0; }
.tl-read h2 { margin: 52px 0 16px; font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.12; color: var(--tl-text); }
.tl-read h3 { margin: 28px 0 10px; font-family: var(--sans); font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--tl-text); }
.tl-read p, .tl-read li { font-size: 18px; line-height: 1.72; color: var(--tl-body); }
.tl-read p { margin: 0 0 20px; }
.tl-read ul, .tl-read ol { margin: 0 0 22px; padding-left: 1.4em; }
.tl-read li { margin-bottom: 8px; }
.tl-read li::marker { color: var(--orange); }
.tl-read a { color: var(--orange); text-decoration: underline; text-decoration-color: rgba(247, 147, 26, 0.45); text-underline-offset: 3px; }
.tl-read a:hover { color: #ffb257; text-decoration-color: currentColor; }
.tl-read a[href^="/glossary"] { color: var(--tl-text); text-decoration-style: dotted; text-decoration-color: var(--orange); text-underline-offset: 4px; }
.tl-read table { width: 100%; margin: 0 0 22px; border-collapse: collapse; font-size: 15px; }
.tl-read th, .tl-read td { padding: 10px 12px 10px 0; border-top: 1px solid var(--tl-line); text-align: left; color: var(--tl-quiet); }
.tl-read thead th { border-top: 0; font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tl-muted); }
.tl-read .tl-read-k { margin: 0 0 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange); }
.tl-read .tl-read-k + h2 { margin-top: 0; }
/* FAQ, ruled, as on the guides */
.tl-faq { border-top: 1px solid var(--tl-line); }
.tl-faq:last-of-type { border-bottom: 1px solid var(--tl-line); }
.tl-faq > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 8px 0; cursor: pointer; list-style: none; }
.tl-faq > summary::-webkit-details-marker { display: none; }
.tl-faq > summary h3 { margin: 0; font-family: var(--sans); font-size: 18px; font-weight: 700; line-height: 1.4; color: var(--tl-text); }
.tl-faq-a { padding-bottom: 6px; }
.tl-faq-a p, .tl-faq-a { font-size: 17px; line-height: 1.7; color: var(--tl-body); }
/* Related tools */
.tl-related { padding-top: 44px; }
.tl-related h2 { margin: 0 0 14px; font-size: 28px; }
.tl-read .tl-related-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tl-read .tl-related-list li { margin: 0; }
.tl-read .tl-tool-card { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 20px; border: 1px solid var(--tl-line); border-radius: 14px; color: var(--tl-text); text-decoration: none; }
.tl-read .tl-tool-card:hover { border-color: var(--tl-outline); color: var(--tl-text); }
.tl-tool-card-k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tl-muted); }
.tl-tool-card-t { font-family: var(--serif); font-size: 22px; line-height: 1.15; }
.tl-tool-card-d { font-size: 15px; line-height: 1.5; color: var(--tl-muted); }
.tl-tool-card-go { font-size: 15px; font-weight: 600; color: var(--orange); }

/* ── Newsletter band (Substack; subscribe-bar.js handles the submit) ── */
.tl-band { background: var(--tl-warm); border-top: 1px solid var(--tl-warm-line); border-bottom: 1px solid var(--tl-warm-line); }
.tl-band-in { max-width: 1304px; margin: 0 auto; padding: 44px 32px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 48px; }
.tl-band-h { flex: 1 1 420px; margin: 0; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.15; color: var(--tl-text); }
.tl-band-h em { color: var(--orange); }
.tl-form.bw-subscribe-form { flex: 1 1 420px; display: flex; gap: 10px; width: auto; }
.tl-input { flex: 1 1 auto; min-width: 0; height: 52px; padding: 0 16px; background: var(--tl-field); color: var(--tl-text); border: 1px solid var(--tl-chip-line); border-radius: 10px; font-family: var(--sans); font-size: 16px; }
.tl-input::placeholder { color: #8f897f; opacity: 1; }
.tl-input:focus { border-color: var(--orange); }
.tl-form-btn.bw-subscribe-btn { height: 52px; padding: 0 22px; background: var(--orange); color: var(--tl-ink); border: 0; border-radius: 10px; box-shadow: none; font-family: var(--sans); font-size: 16px; font-weight: 700; }
.tl-form-btn.bw-subscribe-btn:hover { background: #ffa53d; transform: none; box-shadow: none; }

/* ── Save image card (built off screen by ToolUI.shareImage, captured with html2canvas) ── */
.tl-imgcard { position: fixed; left: -10000px; top: 0; width: 800px; padding: 44px 48px 36px; background: var(--tl-warm); border: 2px solid var(--tl-answer-line); border-radius: 0; color: var(--tl-text); font-family: var(--sans); }
.tl-imgcard-top { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--mono); font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tl-muted); }
.tl-imgcard-logo { font-family: var(--serif); font-size: 30px; letter-spacing: 0; text-transform: none; color: var(--tl-text); }
.tl-imgcard-logo span { color: var(--orange); }
.tl-imgcard-k { margin-top: 34px; font-family: var(--mono); font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange); }
.tl-imgcard-big { margin-top: 6px; font-family: var(--serif); font-size: 110px; line-height: 1; }
.tl-imgcard-ctx { margin-top: 12px; font-size: 24px; line-height: 1.4; color: var(--tl-soft); }
.tl-imgcard-grid { display: flex; gap: 14px; margin-top: 30px; }
.tl-imgcard-cell { flex: 1; padding: 16px 18px; background: var(--tl-card); border: 1px solid var(--tl-line); border-radius: 12px; }
.tl-imgcard-cell span { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tl-muted); }
.tl-imgcard-cell b { display: block; margin-top: 6px; font-size: 26px; font-variant-numeric: tabular-nums; }
.tl-imgcard-foot { display: flex; justify-content: space-between; margin-top: 30px; font-family: var(--mono); font-size: 13px; color: var(--tl-dim); }

/* Touch screens: 44px targets */
@media (pointer: coarse) {
    .tl-chip-btn { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .tl *, .tl *::before, .tl *::after { transition: none !important; animation: none !important; }
}

/* ── Desktop: a compact answer card, so the chart under it is in view when an input changes ──
   Every Calculator-variant tool (.tl without --readout), and readouts that opt in with .tl--compact.
   At 1440x900 the whole chart frame is visible on first load. Phones keep their order and sizes. */
@media (min-width: 1000px) {
    .tl:not(.tl--readout) .tl-results, .tl--compact .tl-results { gap: 12px; }
    .tl:not(.tl--readout) .tl-answer, .tl--compact .tl-answer { gap: 24px; padding: 18px 24px; }
    .tl:not(.tl--readout) .tl-big, .tl--compact .tl-big { margin-top: 4px; font-size: 60px; }
    .tl:not(.tl--readout) .tl-context, .tl--compact .tl-context { margin-top: 6px; font-size: 16px; line-height: 1.45; }
    .tl:not(.tl--readout) .tl-chips-out, .tl--compact .tl-chips-out { margin-top: 8px; }
    .tl:not(.tl--readout) .tl-answer-side > .tl-k, .tl--compact .tl-answer-side > .tl-k { margin-bottom: 4px; }
    .tl:not(.tl--readout) .tl-bar, .tl--compact .tl-bar { padding: 2px 0; }
    /* Each bar on one line: the change sits beside the value instead of under it */
    .tl:not(.tl--readout) .tl-bar-d, .tl--compact .tl-bar-d { display: inline; margin-left: 6px; }
    .tl:not(.tl--readout) .tl-answer, .tl--compact .tl-answer { padding-top: 16px; padding-bottom: 16px; }
    .tl:not(.tl--readout) .tl-chart, .tl--compact .tl-chart { padding: 14px 18px; }
    .tl:not(.tl--readout) .tl-chart figcaption, .tl--compact .tl-chart figcaption { margin-bottom: 8px; }
    .tl:not(.tl--readout) .tl-chart-box, .tl--compact .tl-chart-box { height: 300px; }
}

/* ── Stacked layout below 1000px: the panel comes first, the headline pins to the top ── */
@media (max-width: 999px) {
    .tl-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
    .tl-panel { position: static; }
    .tl-pin { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 18px -32px 0; padding: 12px 32px; background: var(--tl-warm); border-top: 1px solid var(--tl-answer-line); border-bottom: 1px solid var(--tl-answer-line); }
    .tl-pin[hidden] { display: none; }
    .tl-pin-k { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange); }
    .tl-pin-v { font-family: var(--serif); font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--tl-text); }
    .tl-pin-s { text-align: right; font-size: 13px; line-height: 1.4; color: var(--tl-soft); }
    .tl-pin-s b { display: block; font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--orange); }
    /* The answer's headline lives in the pinned bar on phones and tablets */
    .tl-answer { grid-template-columns: minmax(0, 1fr); }
    .tl-answer.has-pin { grid-template-columns: minmax(0, 1fr); padding: 20px; background: var(--tl-card); border-color: var(--tl-line); }
    .tl-answer.has-pin .tl-answer-main { display: none; }
    .tl-pair { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
    .tl { font-size: 16px; }
    .tl-wrap { padding: 22px 16px 0; }
    .tl-head h1 { font-size: 40px; }
    .tl-desc { font-size: 16px; }
    .tl-pin { margin: 18px -16px 0; padding: 12px 16px; }
    .tl-panel { padding: 20px; }
    .tl-answer { padding: 20px; gap: 18px; }
    .tl-big { font-size: 56px; }
    .tl-bar { grid-template-columns: minmax(0, 1fr) minmax(40px, 1fr) minmax(70px, auto); gap: 10px; }
    .tl-bar-l { font-size: 14px; }
    .tl-bar-v { font-size: 15px; }
    .tl-chart { padding: 16px 14px; }
    .tl-chart-box { height: 260px; }
    .tl-read { margin-top: 48px; padding-bottom: 44px; }
    .tl-read h2 { margin-top: 44px; font-size: 27px; }
    .tl-read p, .tl-read li { font-size: 17px; }
    .tl-related-list { grid-template-columns: minmax(0, 1fr); }
    .tl-band-in { padding: 26px 16px; gap: 10px; }
    .tl-band-h { flex-basis: 100%; font-size: 22px; line-height: 1.2; }
    .tl-form.bw-subscribe-form { flex-basis: 100%; flex-direction: column; }
    .tl-input, .tl-form-btn.bw-subscribe-btn { flex: none; width: 100%; height: 50px; }
}

/* ── Explainer extras: stat callouts and small badges ── */
.tl-read .tl-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 4px 0 26px; }
.tl-fact { margin: 0; padding: 16px 18px; border: 1px solid var(--tl-line); border-radius: 12px; }
.tl-fact dt { font-family: var(--serif); font-size: 32px; line-height: 1.1; color: var(--orange); }
.tl-fact dd { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--tl-muted); }
.tl-read .tl-fact dd a { color: inherit; }
.tl-badge { display: inline-block; margin-left: 6px; padding: 2px 6px; border: 1px solid var(--tl-warm-line); border-radius: 4px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange); vertical-align: 2px; white-space: nowrap; }
.tl-read .tl-read-more { font-size: 15px; color: var(--tl-muted); }
@media (max-width: 640px) {
    .tl-read .tl-facts { grid-template-columns: minmax(0, 1fr); }
}
