/* The free tools (routes/marketing.js /tools, lib/tools.js, 2026-11-04):
   the hub (.tl) and the compound interest calculator (.ci). Loaded after
   doc.css and guides.css, whose essay, card and FAQ styles the pages use.
   Every colour is a --lp-* token or one of the chart's three below, so the
   light and dark themes both follow.

   The chart's colours do one job each and were checked with the dataviz
   palette validator (lightness band, chroma floor, CVD and normal-vision
   separation of all three pairs, contrast) on both card surfaces of both
   themes, ink-2 and ink-1; all pass:
     --ci-grow  growth, and plan A's balance   light #a55a12 (the site's amber)  dark #cb8315
     --ci-put   what you put in                light #3a80b7 (the site's sky)    dark #3e8cc9
     --ci-alt   today's money, and plan B      light #9b2b6a (the site's rose)   dark #b54481
   The dark steps are the same hues, set inside the dark band (the site's
   bright amber is too light for a mark on the dark card). Text never wears
   them: values and labels are --lp-text, --lp-text-2 and --lp-muted, with a
   coloured key beside them. */

.ci {
  --ci-grow: #cb8315; --ci-put: #3e8cc9; --ci-alt: #b54481;
  --ci-surface: var(--lp-ink-2);
  --ci-panel: var(--lp-ink-1);
}
html[data-theme="light"] .ci, html[data-theme="light"] .tl { --ci-grow: #a55a12; --ci-put: #3a80b7; --ci-alt: #9b2b6a; }
.tl { --ci-grow: #cb8315; --ci-put: #3e8cc9; }

/* What needs the script waits for it: inline words are left out, and the
   controls keep their place, so nothing moves when the page comes alive. */
.ci span.ci-js { display: none; }
.ci.is-live span.ci-js { display: inline; }
.ci :is(div, p).ci-js { visibility: hidden; }
.ci.is-live :is(div, p).ci-js { visibility: visible; }

/* ---- the head: shorter than an essay's, so the calculator is on the first screen ---- */
.ci .ci-head { padding-top: clamp(18px, 3vw, 40px); }
.ci .ci-crumb { text-decoration: none; }
.ci .ci-crumb:hover { color: var(--lp-amber-2); }
body.lp-dark .ci .ci-h1 { max-width: 26ch; margin-bottom: 14px; font-size: clamp(1.85rem, 1.2rem + 2.3vw, 3.05rem); line-height: 1.04; }
.ci .ci-h1 em { display: block; }
.ci .ab-stand.ci-stand { max-width: 52ch; font-size: clamp(1rem, .95rem + .35vw, 1.2rem); }

/* ---- the card ------------------------------------------------------------- */
.ci .ci-tool { margin-top: clamp(24px, 3.6vw, 44px); }
.ci-card {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 372px); align-items: start;
  border: 1px solid var(--lp-line-2); border-radius: 28px; background: var(--ci-surface);
  box-shadow: 0 50px 100px -56px color-mix(in srgb, var(--lp-shadow-c) 95%, transparent), 0 0 80px -40px rgba(242,169,59,.32);
}
.ci-result { position: sticky; top: 72px; min-width: 0; padding: clamp(18px, 2.8vw, 32px); }
.ci-inputs {
  min-width: 0; padding: clamp(18px, 2.4vw, 28px); align-self: stretch;
  border-left: 1px solid var(--lp-line); border-radius: 0 27px 27px 0; background: var(--ci-panel);
}

/* the hero: the one figure the page leads with, in the site's sans */
.ci .ci-hero__label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0; font: 500 .74rem/1.4 var(--lp-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--lp-muted); }
.ci-tag {
  display: inline-block; padding: 3px 8px 2px; border-radius: 999px; letter-spacing: .1em;
  border: 1px solid color-mix(in srgb, var(--lp-amber) 45%, transparent); color: var(--lp-amber-2);
}
.ci-tag[hidden] { display: none; }
.ci .ci-hero__value {
  margin: 8px 0 0; font: 600 clamp(2.5rem, 1.7rem + 3.7vw, 4.4rem)/1.02 var(--lp-sans); letter-spacing: -.035em;
  color: var(--lp-text); font-variant-numeric: proportional-nums; overflow-wrap: anywhere;
}
.ci .ci-hero__value.is-long { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); }
.ci .ci-hero__value.is-huge { font-size: clamp(1.3rem, 1rem + 1.4vw, 1.9rem); }
.ci .ci-hero__split { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 12px 0 0; font: 400 1.02rem/1.5 var(--lp-sans); color: var(--lp-text-2); }
.ci .ci-hero__split b { font-weight: 600; color: var(--lp-text); font-variant-numeric: tabular-nums; }
.ci-hero__part { white-space: nowrap; }
.ci-key { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 3px; vertical-align: 0; }
.ci-key--put { background: var(--ci-put); }
.ci-key--grow { background: var(--ci-grow); }
.ci .ci-hero__more { margin: 6px 0 0; font: 400 .95rem/1.5 var(--lp-sans); color: var(--lp-text-2); }
.ci .ci-hero__more b { font-weight: 600; color: var(--lp-text); }
.ci .ci-hero__more[hidden] { display: none; }
.ci .ci-hero__turn { display: flex; align-items: center; gap: 9px; }
.ci-turnkey { flex: none; width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box; border: 2px solid var(--ci-grow); background: var(--ci-surface); }

/* ---- the chart -------------------------------------------------------------- */
.ci .ci-chart { margin: 22px 0 0; }
.ci-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; font: 500 .8rem/1.3 var(--lp-sans); color: var(--lp-text-2); }
.ci-legend__item { display: inline-flex; align-items: center; gap: 7px; }
.ci-legend__item[hidden] { display: none; }
/* swatches mirror the marks: a block for a band, a short line for a line */
.ci-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.ci-sw--grow { background: color-mix(in srgb, var(--ci-grow) 55%, transparent); box-shadow: inset 0 2px 0 var(--ci-grow); }
.ci-sw--put { background: color-mix(in srgb, var(--ci-put) 40%, transparent); box-shadow: inset 0 2px 0 var(--ci-put); }
.ci-sw--line { height: 2px; width: 16px; border-radius: 2px; box-shadow: none; }
.ci-sw--line.ci-sw--grow { background: var(--ci-grow); }
.ci-sw--line.ci-sw--alt { background: var(--ci-alt); }

.ci-plot { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); border-radius: 14px; outline: 0; }
.ci-plot:focus-visible { box-shadow: 0 0 0 3px var(--ci-surface), 0 0 0 5px var(--lp-amber); }
.ci-y { position: relative; min-width: 3.4em; margin-right: 8px; }
.ci-y span {
  position: absolute; right: 0; transform: translateY(50%); white-space: nowrap;
  font: 400 .7rem/1 var(--lp-mono); color: var(--lp-muted); font-variant-numeric: tabular-nums;
}
.ci-area { position: relative; height: clamp(230px, 30vw, 330px); touch-action: pan-y; cursor: crosshair; }
.ci-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ci-grid { fill: none; stroke: var(--lp-line); stroke-width: 1; vector-effect: non-scaling-stroke; shape-rendering: crispEdges; }
.ci-base { fill: none; stroke: var(--lp-line-2); stroke-width: 1; vector-effect: non-scaling-stroke; shape-rendering: crispEdges; }
.ci-glow__top { stop-color: var(--ci-grow); stop-opacity: .34; }
.ci-glow__end { stop-color: var(--ci-grow); stop-opacity: .07; }
html[data-theme="light"] .ci-glow__top { stop-opacity: .26; }
.ci-fill--grow { fill: url(#ci-glow); }
.ci-fill--put { fill: var(--ci-put); fill-opacity: .17; }
html[data-theme="light"] .ci-fill--put { fill-opacity: .14; }
/* the 2px surface gap that keeps the two bands apart, either side of the line between them */
.ci-gap { fill: none; stroke: var(--ci-surface); stroke-width: 6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ci-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.ci-line--grow { stroke: var(--ci-grow); }
.ci-line--put { stroke: var(--ci-put); }
.ci-line--alt { stroke: var(--ci-alt); }
/* Compare: two lines, no bands */
.ci.is-compare :is(.ci-fill, .ci-gap, .ci-line--put) { display: none; }

.ci-x { grid-column: 2; position: relative; height: 26px; }
.ci-x span {
  position: absolute; top: 9px; transform: translateX(-50%); white-space: nowrap;
  font: 400 .7rem/1 var(--lp-mono); color: var(--lp-muted); font-variant-numeric: tabular-nums;
}
.ci-x span:first-child { transform: none; }
.ci-x span.is-last { transform: translateX(-100%); }

/* marks on the plot, placed in HTML by percent so they stay round at any width */
.ci-marks, .ci-hover { position: absolute; inset: 0; pointer-events: none; }
.ci-ms { position: absolute; left: 0; height: 0; border-top: 1px solid color-mix(in srgb, var(--ci-grow) 50%, transparent); }
.ci-ms__label {
  position: absolute; left: 4px; bottom: 4px; padding: 2px 6px; border-radius: 6px; white-space: nowrap;
  font: 500 .68rem/1.25 var(--lp-mono); color: var(--lp-text-2); background: color-mix(in srgb, var(--ci-surface) 84%, transparent);
}
.ci-ms__dot { position: absolute; right: -4px; top: -4.5px; width: 8px; height: 8px; border-radius: 50%; background: var(--ci-grow); box-shadow: 0 0 0 2px var(--ci-surface); }
.ci-turn { position: absolute; width: 0; height: 0; }
.ci-turn__ring {
  position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; box-sizing: border-box;
  border: 2px solid var(--ci-grow); background: var(--ci-surface); box-shadow: 0 0 0 2px var(--ci-surface);
}
.ci-turn__label {
  position: absolute; left: 12px; top: 8px; padding: 3px 8px; border-radius: 8px; white-space: nowrap;
  font: 600 .7rem/1.25 var(--lp-sans); color: var(--lp-text); background: color-mix(in srgb, var(--ci-surface) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--ci-grow) 40%, transparent);
}
.ci-turn.is-left .ci-turn__label { left: auto; right: 12px; }
.ci-turn.is-above .ci-turn__label { top: auto; bottom: 10px; }
.ci-end { position: absolute; width: 0; height: 0; }
.ci-end__dot {
  position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--ci-grow);
  box-shadow: 0 0 0 2px var(--ci-surface), 0 0 18px color-mix(in srgb, var(--ci-grow) 75%, transparent);
}
.ci-end__dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1.5px solid var(--ci-grow); opacity: 0; animation: ci-pulse 2.8s ease-out infinite; }
.ci-end--put .ci-end__dot, .ci-end--alt .ci-end__dot { width: 8px; height: 8px; left: -4px; top: -4px; box-shadow: 0 0 0 2px var(--ci-surface); }
.ci-end--put .ci-end__dot { background: var(--ci-put); }
.ci-end--alt .ci-end__dot { background: var(--ci-alt); }
.ci-end--put .ci-end__dot::after, .ci-end--alt .ci-end__dot::after { display: none; }
.ci.is-compare .ci-end--alt .ci-end__dot { width: 12px; height: 12px; left: -6px; top: -6px; }
/* each end's figure sits just left of its dot, above its own line */
.ci-end__label {
  position: absolute; right: 13px; top: -9px; padding: 2px 6px; border-radius: 6px; white-space: nowrap;
  font: 600 .78rem/1.1 var(--lp-sans); color: var(--lp-text); font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--ci-surface) 82%, transparent);
}
.ci-end--put .ci-end__label { font-weight: 500; color: var(--lp-text-2); }
.ci-end.is-hidden, .ci-end__label.is-hidden, .ci-ms__label.is-hidden, .ci-turn__label.is-hidden { display: none; }
@keyframes ci-pulse { 0% { transform: scale(.6); opacity: .7; } 80%, 100% { transform: scale(1.5); opacity: 0; } }

/* the hover layer: a hairline that finds the year, a dot on each line, one readout */
.ci-hover[hidden] { display: none; }
.ci-hover__line { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--lp-line-2); }
.ci-hover__dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; box-shadow: 0 0 0 2px var(--ci-surface); }
.ci-hover__dot[hidden] { display: none; }
.ci-hover__dot--grow { background: var(--ci-grow); }
.ci-hover__dot--put { background: var(--ci-put); }
.ci-hover__dot--alt { background: var(--ci-alt); }
.ci-tip {
  position: absolute; top: 6px; min-width: 176px; max-width: 232px; padding: 10px 12px 11px; border-radius: 14px;
  border: 1px solid var(--lp-line-2); background: color-mix(in srgb, var(--ci-panel) 94%, transparent);
  box-shadow: 0 22px 44px -18px color-mix(in srgb, var(--lp-shadow-c) 85%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.ci-tip__h { margin: 0 0 6px; font: 500 .68rem/1.3 var(--lp-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--lp-muted); }
.ci-tip__row { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 0 8px; align-items: baseline; margin: 0; }
.ci-tip__row + .ci-tip__row { margin-top: 3px; }
/* values lead, labels follow; a short stroke keys each row */
.ci-tip__key { align-self: center; width: 14px; height: 2px; border-radius: 2px; }
.ci-tip__v { font: 600 .95rem/1.3 var(--lp-sans); color: var(--lp-text); font-variant-numeric: tabular-nums; }
.ci-tip__v small { margin-left: 6px; font: 400 .76rem/1.3 var(--lp-sans); color: var(--lp-muted); }
.ci-tip__note { margin: 7px 0 0; padding-top: 7px; border-top: 1px solid var(--lp-line); font: 400 .76rem/1.4 var(--lp-sans); color: var(--lp-text-2); }
.ci-tip__note b { color: var(--lp-text); font-weight: 600; }
.ci-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 20px; text-align: center; font: 400 .95rem/1.5 var(--lp-sans); color: var(--lp-muted); }
.ci-empty[hidden] { display: none; }
.ci .ci-chart__cap { margin: 8px 0 0; font: 400 .82rem/1.5 var(--lp-sans); color: var(--lp-muted); }

/* ---- what if ------------------------------------------------------------------ */
.ci-whatif { margin-top: 22px; }
.ci .ci-whatif__h { margin: 0 0 10px; font: 500 .7rem/1.3 var(--lp-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--lp-muted); }
.ci-whatif__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ci-nudge {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; padding: 14px 16px; text-align: left; cursor: pointer;
  border: 1px solid var(--lp-line-2); border-radius: 16px; background: var(--ci-panel); color: var(--lp-text);
  transition: border-color .2s, transform .2s, background-color .2s;
}
.ci-nudge:hover { border-color: color-mix(in srgb, var(--lp-amber) 55%, transparent); transform: translateY(-1px); }
.ci-nudge[hidden] { display: none; }
.ci-nudge:focus-visible { outline: 3px solid var(--lp-amber); outline-offset: 2px; }
.ci:not(.is-live) .ci-nudge { cursor: default; }
.ci:not(.is-live) .ci-nudge:hover { transform: none; border-color: var(--lp-line-2); }
.ci-nudge__k { font: 500 .86rem/1.35 var(--lp-sans); color: var(--lp-text-2); }
.ci-nudge__v { font: 600 1.3rem/1.15 var(--lp-sans); letter-spacing: -.01em; color: var(--lp-text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ci-nudge__s { font: 400 .78rem/1.4 var(--lp-sans); color: var(--lp-muted); }

/* ---- sharing ------------------------------------------------------------------ */
.ci-share { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--lp-line); }
.ci-btn {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 10px 18px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--lp-amber) 45%, transparent); border-radius: 999px; background: transparent;
  color: var(--lp-amber-2); font: 600 .92rem/1.2 var(--lp-sans); transition: background-color .2s, border-color .2s;
}
.ci-btn:hover { background: color-mix(in srgb, var(--lp-amber) 10%, transparent); border-color: var(--lp-amber); }
.ci-btn:focus-visible { outline: 3px solid var(--lp-amber); outline-offset: 2px; }
.ci-btn .icon { width: 17px; height: 17px; }
.ci-btn[hidden] { display: none; }
.ci .ci-share__note { margin: 10px 0 0; font: 400 .84rem/1.55 var(--lp-sans); color: var(--lp-muted); }
.ci-share__out { margin-top: 10px; }
.ci-share__out[hidden] { display: none; }
.ci-link { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--lp-line-2); border-radius: 12px; background: var(--lp-ink-0); color: var(--lp-text); font: 400 .82rem/1 var(--lp-mono); }
.ci .ci-share__done { min-height: 1.3em; margin: 8px 0 0; font: 500 .86rem/1.4 var(--lp-sans); color: var(--lp-text-2); }

/* ---- the inputs ---------------------------------------------------------------- */
.ci-inputs__top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ci .ci-label { display: block; margin: 0; font: 600 .88rem/1.35 var(--lp-sans); color: var(--lp-text); }
.ci-cur .ci-label { margin-bottom: 6px; }
.ci-select {
  width: 100%; height: 44px; padding: 0 34px 0 12px; border: 1px solid var(--lp-line-2); border-radius: 12px; cursor: pointer;
  appearance: none; -webkit-appearance: none; background-color: var(--lp-ink-0); color: var(--lp-text); font: 500 .92rem/1 var(--lp-sans);
  background-image: linear-gradient(45deg, transparent 50%, var(--lp-muted) 50%), linear-gradient(135deg, var(--lp-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.ci-select:focus-visible { outline: 0; border-color: rgba(242,169,59,.65); box-shadow: 0 0 0 4px rgba(242,169,59,.14); }
.ci-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; padding: 3px; border: 1px solid var(--lp-line-2); border-radius: 13px; background: var(--lp-ink-0); }
.ci-seg button {
  min-height: 38px; padding: 6px 10px; border: 0; border-radius: 10px; cursor: pointer; background: transparent;
  color: var(--lp-text-2); font: 500 .85rem/1.2 var(--lp-sans); transition: background-color .15s, color .15s;
}
.ci-seg button:hover { color: var(--lp-text); }
.ci-seg button[aria-pressed="true"] { background: var(--ci-surface); color: var(--lp-text); font-weight: 600; box-shadow: 0 1px 3px color-mix(in srgb, var(--lp-shadow-c) 45%, transparent), inset 0 0 0 1px var(--lp-line-2); }
.ci-seg button:focus-visible { outline: 2px solid var(--lp-amber); outline-offset: 1px; }
.ci-view { min-width: 0; }
.ci .ci-note { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; font: 400 .84rem/1.45 var(--lp-sans); color: var(--lp-text-2); }
.ci .ci-note[hidden] { display: none; }
.ci-note .icon { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--lp-amber); }

.ci-plan { margin-top: 6px; }
.ci-plan[hidden] { display: none; }
.ci-field { margin: 0; padding: 14px 0 6px; border-top: 1px solid var(--lp-line); }
.ci-plan > .ci-field:first-child, .ci-adv__h + .ci-field, .ci-plan--b > .ci-hint + .ci-field { border-top: 0; }
.ci-field__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ci-field--choice { padding-bottom: 14px; }
.ci-field--choice .ci-label { margin-bottom: 8px; }
.ci-num {
  display: flex; align-items: center; gap: 4px; flex: 0 1 9.75rem; min-width: 7rem; height: 44px; padding: 0 12px;
  border: 1px solid var(--lp-line-2); border-radius: 12px; background: var(--lp-ink-0); color: var(--lp-muted);
  transition: border-color .2s, box-shadow .2s;
}
.ci-num:focus-within { border-color: rgba(242,169,59,.65); box-shadow: 0 0 0 4px rgba(242,169,59,.14); }
.ci-num__pre, .ci-num__post { flex: none; font: 500 .9rem/1 var(--lp-mono); color: var(--lp-muted); }
.ci-num__in {
  flex: 1; width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; text-align: right;
  color: var(--lp-text); font: 500 1.02rem/1 var(--lp-mono); font-variant-numeric: tabular-nums;
}
.ci .ci-hint { margin: 0 0 8px; font: 400 .8rem/1.45 var(--lp-sans); color: var(--lp-muted); }
.ci-field[data-kind] .ci-hint { margin-top: -2px; }

/* Sliders: a thin track, and a thumb big enough for a thumb. The whole input
   is 44px tall, so a finger finds it; vertical swipes still scroll the page. */
.ci-range {
  --p: 50%; --ci-fill: var(--ci-grow);
  display: block; width: 100%; height: 44px; margin: 2px 0 0; padding: 0; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none; touch-action: pan-y;
}
.ci-plan--b .ci-range { --ci-fill: var(--ci-alt); }
.ci-range::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--ci-fill) var(--p), var(--lp-line-2) var(--p)); }
.ci-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%;
  border: 2px solid var(--ci-fill); background: var(--lp-ink-2);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--lp-shadow-c) 55%, transparent); transition: transform .12s, box-shadow .12s;
}
.ci-range:active::-webkit-slider-thumb { transform: scale(1.12); }
.ci-range::-moz-range-track { height: 6px; border-radius: 99px; background: var(--lp-line-2); }
.ci-range::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--ci-fill); }
.ci-range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ci-fill); background: var(--lp-ink-2); box-shadow: 0 2px 8px color-mix(in srgb, var(--lp-shadow-c) 55%, transparent); }
.ci-range:focus { outline: 0; }
.ci-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px color-mix(in srgb, var(--lp-amber) 40%, transparent); }
.ci-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 5px color-mix(in srgb, var(--lp-amber) 40%, transparent); }

.ci-adv { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--lp-line-2); }
.ci-adv[hidden] { display: none; }
.ci .ci-adv__h { margin: 4px 0 2px; font: 500 .68rem/1.3 var(--lp-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--lp-muted); }
.ci-compare { margin-top: 18px; }
.ci-compare[hidden] { display: none; }
.ci-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 10px 14px; cursor: pointer; text-align: left;
  border: 1px solid var(--lp-line-2); border-radius: 14px; background: var(--ci-surface); color: var(--lp-text); font: 600 .95rem/1.3 var(--lp-sans);
}
.ci-toggle:hover { border-color: color-mix(in srgb, var(--ci-alt) 55%, transparent); }
.ci-toggle:focus-visible { outline: 3px solid var(--lp-amber); outline-offset: 2px; }
.ci-toggle__box { position: relative; flex: none; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--lp-line-2); }
.ci-toggle[aria-pressed="true"] .ci-toggle__box { border-color: var(--ci-alt); background: var(--ci-alt); }
.ci-toggle[aria-pressed="true"] .ci-toggle__box::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ci-plan--b { margin-top: 12px; padding: 4px 14px 6px; border: 1px solid color-mix(in srgb, var(--ci-alt) 38%, transparent); border-radius: 16px; background: color-mix(in srgb, var(--ci-alt) 5%, var(--ci-panel)); }
.ci-plan__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 4px; }
.ci .ci-plan__h { display: flex; align-items: center; gap: 8px; margin: 0; font: 600 .95rem/1.3 var(--lp-sans); color: var(--lp-text); }
.ci-linkbtn { min-height: 36px; padding: 6px 2px; border: 0; background: none; cursor: pointer; color: var(--lp-amber-2); font: 600 .84rem/1.2 var(--lp-sans); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ci-linkbtn:focus-visible { outline: 2px solid var(--lp-amber); outline-offset: 2px; border-radius: 4px; }

/* the running total that follows a phone's thumb down the inputs */
.ci-mini {
  position: sticky; bottom: 12px; z-index: 4; display: none; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 16px 0 0; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--lp-line-2); background: var(--ci-surface);
  box-shadow: 0 18px 40px -12px color-mix(in srgb, var(--lp-shadow-c) 80%, transparent);
}
.ci-mini__when { font: 500 .72rem/1.3 var(--lp-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--lp-muted); }
.ci-mini__value { font: 600 1.25rem/1.1 var(--lp-sans); color: var(--lp-text); font-variant-numeric: tabular-nums; }

/* ---- the table -------------------------------------------------------------------- */
.ci-years { max-width: 100%; margin: 18px 0 0; border: 1px solid var(--lp-line); border-radius: 20px; background: var(--ci-panel); }
.ci-years > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px 20px; cursor: pointer; list-style: none;
  font: 600 .95rem/1.3 var(--lp-sans); color: var(--lp-text);
}
.ci-years > summary::-webkit-details-marker { display: none; }
.ci-years > summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 1.5px solid var(--lp-amber); border-bottom: 1.5px solid var(--lp-amber); transform: translateY(-3px) rotate(45deg); transition: transform .2s; }
.ci-years[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.ci-years > summary:focus-visible { outline: 3px solid var(--lp-amber); outline-offset: 2px; border-radius: 20px; }
.ci-years__scroll { max-height: 440px; overflow: auto; margin: 0 10px; border-top: 1px solid var(--lp-line); overscroll-behavior: contain; }
.ci-years__scroll:focus-visible { outline: 3px solid var(--lp-amber); outline-offset: 2px; }
.ci-table { width: 100%; border-collapse: collapse; font: 400 .88rem/1.4 var(--lp-sans); color: var(--lp-text-2); font-variant-numeric: tabular-nums; }
.ci-table caption { caption-side: top; padding: 12px 10px 8px; text-align: left; font: 400 .8rem/1.45 var(--lp-sans); color: var(--lp-muted); }
.ci-table th, .ci-table td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--lp-line); }
.ci-table thead th { position: sticky; top: 0; z-index: 1; background: var(--ci-panel); font: 500 .66rem/1.3 var(--lp-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--lp-muted); }
.ci-table tbody th, .ci-table thead th:first-child { text-align: left; }
.ci-table tbody th { font-weight: 500; color: var(--lp-text); }
.ci-table td:nth-child(4) { color: var(--lp-text); font-weight: 600; }
.ci-table [hidden] { display: none; }
.ci-table tr.is-turn > * { background: color-mix(in srgb, var(--ci-grow) 9%, transparent); }
/* a narrow screen's line of extra figures under each year */
.ci-table tr.has-sub > * { border-bottom: 0; padding-bottom: 2px; }
.ci-table tr.ci-sub td { padding-top: 0; text-align: left; white-space: normal; font-size: .78rem; color: var(--lp-muted); }
.ci-years__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 20px 18px; }
.ci .ci-years__fine { margin: 0; font: 400 .8rem/1.4 var(--lp-sans); color: var(--lp-muted); }

.ci .ci-privacy { display: flex; gap: 10px; max-width: 760px; margin: 18px auto 0; font: 400 .86rem/1.55 var(--lp-sans); color: var(--lp-muted); }
.ci-privacy .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--lp-amber); }
.ci .ci-noscript { max-width: 760px; margin: 12px auto 0; font: 400 .95rem/1.55 var(--lp-sans); color: var(--lp-text-2); }

/* ---- the explainer ------------------------------------------------------------------ */
.ci .ci-essay { margin-top: clamp(56px, 7vw, 96px); }
.ci .ci-essay > h2:first-child { margin-top: 0; }
.ci .gd-body p.ci-formula {
  margin: 1em 0 1.2em; padding: 16px 20px; border-radius: 14px; text-align: center;
  font: 400 clamp(1.02rem, .95rem + .4vw, 1.22rem)/1.6 var(--lp-serif); color: var(--lp-text);
  background: color-mix(in srgb, var(--lp-amber) 8%, transparent); border: 1px solid color-mix(in srgb, var(--lp-amber) 25%, transparent);
}
.ci .gd-body sup { font-size: .68em; line-height: 0; }
.ci .gd-body .ci-steps li { font-variant-numeric: tabular-nums; }
.ci .gd-body p.ci-try { margin: 0 0 1.4em; }
.ci .gd-body .ci-btn { color: var(--lp-amber-2); text-decoration: none; }

/* ---- after the questions ------------------------------------------------------------------ */
.ci .ci-after { margin-top: clamp(40px, 5vw, 64px); margin-bottom: clamp(72px, 9vw, 120px); }
.ci .ci-disclaimer { margin-top: 0; }
.ci-soft {
  max-width: 760px; margin: 28px auto 0; padding: clamp(22px, 3.4vw, 32px); text-align: center;
  border: 1px solid var(--lp-line); border-radius: 22px; background: linear-gradient(180deg, var(--lp-ink-2), var(--lp-ink-1));
}
.ci .ci-soft__line { max-width: 46ch; margin: 0 auto; font: italic 400 clamp(1.15rem, 1.05rem + .5vw, 1.42rem)/1.5 var(--lp-serif); color: var(--lp-text); text-wrap: balance; }
.ci .ci-soft__go { margin: 16px 0 0; font: 400 .92rem/1.6 var(--lp-sans); color: var(--lp-muted); }
.ci .ci-soft__go a {
  font-weight: 600; color: var(--lp-amber-2); text-decoration: underline; text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--lp-amber) 45%, transparent); text-underline-offset: 3px;
}
.ci .ci-soft__go span { display: block; margin-top: 4px; font-size: .84rem; }
.mkt-main.ci ~ .mkt-footer { margin-top: 0; }

/* ---- narrow screens: the answer first, then the inputs under it ------------------------ */
@media (max-width: 900px) {
  .ci-card { grid-template-columns: minmax(0, 1fr); }
  .ci-result { position: static; }
  .ci-inputs { border-left: 0; border-top: 1px solid var(--lp-line); border-radius: 0 0 27px 27px; }
  .ci-mini:not([hidden]) { display: flex; }
}
@media (max-width: 560px) {
  .ci-card { border-radius: 22px; }
  .ci-inputs { border-radius: 0 0 21px 21px; }
  .ci-result { padding: 18px 16px 20px; }
  .ci-inputs { padding: 16px 16px 18px; }
  .ci .ci-hero__split { font-size: .96rem; }
  .ci-whatif__row { gap: 8px; }
  .ci-nudge { padding: 12px 12px; }
  .ci-nudge__v { font-size: 1.12rem; }
  .ci-y { min-width: 3em; margin-right: 6px; }
  .ci-inputs__top { grid-template-columns: minmax(0, 1fr); }
  .ci-view { min-width: 0; }
  .ci-years > summary { padding: 12px 16px; }
  .ci-years__scroll { margin: 0 4px; }
  .ci-table { font-size: .84rem; }
  .ci-table th, .ci-table td { padding: 8px 5px; }
  .ci-tip { min-width: 156px; padding: 9px 10px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .ci-end__dot::after { animation: none; display: none; }
  .ci-nudge, .ci-range::-webkit-slider-thumb { transition: none; }
  .ci-nudge:hover { transform: none; }
}
@media (forced-colors: active) {
  .ci-line, .ci-grid, .ci-base { stroke: CanvasText; }
  .ci-line--put { stroke-dasharray: 6 3; }
  .ci-line--alt { stroke-dasharray: 2 3; }
}

/* =====================================================================
   The hub (/tools)
   ===================================================================== */
.tl .tl-head { padding-top: clamp(24px, 4vw, 56px); }
body.lp-dark .tl .gd-h1 { max-width: 16ch; margin-bottom: 18px; font-size: clamp(2.2rem, 1.4rem + 3vw, 3.9rem); }
.tl .ab-stand { max-width: 44ch; font-size: clamp(1.04rem, .98rem + .4vw, 1.3rem); }
.tl .tl-list { margin-top: clamp(32px, 4.5vw, 56px); }
.tl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 960px; margin: 0 auto; padding: 0; list-style: none; }
.tl-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  border: 1px solid var(--lp-line); border-radius: 24px; background: linear-gradient(180deg, var(--lp-ink-2), var(--lp-ink-1));
  transition: border-color .2s ease, transform .2s ease;
}
.tl-card:hover { border-color: color-mix(in srgb, var(--lp-amber) 50%, transparent); transform: translateY(-2px); }
.tl-card:focus-within { border-color: var(--lp-amber); }
.tl-card--new { border-color: color-mix(in srgb, var(--lp-amber) 30%, var(--lp-line)); }
.tl-card__art { position: relative; height: 140px; border-bottom: 1px solid var(--lp-line); background: radial-gradient(70% 90% at 70% 100%, color-mix(in srgb, var(--lp-amber) 10%, transparent), transparent 70%); }
.tl-card__art svg { position: absolute; left: 22px; right: 22px; top: 26px; bottom: 18px; width: calc(100% - 44px); height: calc(100% - 44px); overflow: visible; }
.tl-art__grow { fill: color-mix(in srgb, var(--ci-grow) 24%, transparent); }
.tl-art__put { fill: color-mix(in srgb, var(--ci-put) 18%, transparent); }
.tl-art__putline { fill: none; stroke: var(--ci-put); stroke-width: 2; vector-effect: non-scaling-stroke; }
.tl-art__line { fill: none; stroke: var(--ci-grow); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.tl-art__dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--ci-grow); box-shadow: 0 0 0 2px var(--lp-ink-2), 0 0 18px color-mix(in srgb, var(--ci-grow) 70%, transparent); }
.tl-rail { position: absolute; left: 24px; right: 24px; top: 50%; height: 40px; margin-top: -20px; }
.tl-rail__line { position: absolute; left: 0; right: 0; top: 14px; height: 1.5px; background: linear-gradient(90deg, rgba(242,169,59,.18), rgba(242,169,59,.62)); }
.tl-rail__band { position: absolute; left: 22%; width: 9%; top: 8px; height: 13px; border-radius: 7px; border: 1px solid rgba(242,169,59,.55); background: rgba(242,169,59,.24); }
.tl-rail__dot { position: absolute; left: 61%; top: 8px; width: 13px; height: 13px; margin-left: -6.5px; border-radius: 50%; background: var(--lp-amber-2); box-shadow: 0 0 0 5px rgba(242,169,59,.16), 0 0 18px rgba(242,169,59,.8); }
.tl-rail__end { position: absolute; top: 28px; font: 400 .7rem/1 var(--lp-mono); color: var(--lp-faint); }
.tl-rail__end--start { left: 0; }
.tl-rail__end--end { right: 0; }
.tl-card__body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 22px 24px 24px; }
.tl .tl-card__kicker { display: flex; align-items: center; gap: 10px; margin: 0; font: 500 .7rem/1.4 var(--lp-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--lp-amber-2); }
.tl-new { padding: 3px 8px 2px; border-radius: 999px; background: var(--lp-fill); color: #1a1208; font: 600 .62rem/1.2 var(--lp-sans); letter-spacing: .06em; }
.tl .tl-card__title { margin: 0; font: 400 1.5rem/1.25 var(--lp-serif); letter-spacing: -.01em; color: var(--lp-text); text-wrap: balance; }
.tl .tl-card__title a { color: inherit; text-decoration: none; }
/* the whole card is the link's target */
.tl .tl-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: 24px; }
.tl .tl-card__title a:focus-visible { outline: 0; }
.tl .tl-card__title a:focus-visible::after { outline: 3px solid var(--lp-amber); outline-offset: -3px; }
.tl .tl-card__text { margin: 0; font-size: .98rem; line-height: 1.6; color: var(--lp-text-2); }
.tl-card__go { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; font: 600 .9rem/1 var(--lp-sans); color: var(--lp-amber-2); }
.tl-card__go .icon { width: 16px; height: 16px; transition: transform .2s; }
.tl-card:hover .tl-card__go .icon { transform: translateX(3px); }
.tl .tl-more { margin: 26px auto 0; text-align: center; font: italic 400 1.12rem/1.5 var(--lp-serif); color: var(--lp-text-2); }
.tl .tl-promise { margin-top: clamp(48px, 6vw, 80px); margin-bottom: clamp(80px, 10vw, 140px); }
.tl-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 960px; margin: 0 auto; padding: 0; list-style: none; }
.tl-points li { display: flex; gap: 12px; padding: 18px 20px; border: 1px solid var(--lp-line); border-radius: 18px; font: 400 .95rem/1.55 var(--lp-sans); color: var(--lp-text-2); }
.tl-points b { color: var(--lp-text); font-weight: 600; }
.tl-points .icon { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--lp-amber); }
.mkt-main.tl ~ .mkt-footer { margin-top: 0; }
@media (max-width: 860px) {
  .tl-grid, .tl-points { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
}
@media (prefers-reduced-motion: reduce) {
  .tl-card, .tl-card__go .icon { transition: none; }
  .tl-card:hover { transform: none; }
  .tl-card:hover .tl-card__go .icon { transform: none; }
}
