/* /savings-calculator: "The workbench". A tool first page. Scoped under .pg-calc. Keeps the calculator's ids and data attributes. */
.pg-calc {
  --cw-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --cw-gutter: clamp(20px, 5vw, 48px);
  --cw-rule: rgba(var(--ink-rgb), 0.14);
  background: var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(15px, 0.5vw + 13.8px, 17px);
  line-height: 1.6;
  padding-top: 104px;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
:where(.pg-calc) *, :where(.pg-calc) *::before, :where(.pg-calc) *::after { box-sizing: border-box; }
:where(.pg-calc) p, :where(.pg-calc) h1, :where(.pg-calc) h2, :where(.pg-calc) h3, :where(.pg-calc) ul { margin: 0; padding: 0; }
:where(.pg-calc) ul { list-style: none; }
:where(.pg-calc) a { color: inherit; text-decoration: none; }
:where(.pg-calc) a:focus-visible, :where(.pg-calc) button:focus-visible, .pg-calc summary:focus-visible, :where(.pg-calc) input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.cw-wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--cw-gutter); }
.cw-mono { font-family: var(--cw-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }
.cw-label { font-family: var(--cw-mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }

/* ---------- 1. Hero ---------- */
.cw-hero { padding-block: clamp(16px, 2.4vw, 32px) clamp(28px, 4vw, 48px); }
.cw-crumb { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--cw-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }
.cw-crumb a:hover { color: var(--accent); }
.cw-crumb [aria-current] { color: var(--ink); }
.cw-h1 { font-size: clamp(2rem, 3.6vw + 0.6rem, 3.5rem); font-weight: 600; letter-spacing: -0.034em; line-height: 1.06; max-width: 18ch; }
.cw-lede { margin-top: 14px; color: var(--muted); max-width: 56ch; }

/* ---------- 2. Bench ---------- */
.cw-bench { padding-block: clamp(8px, 2vw, 24px) clamp(48px, 7vw, 88px); }
.cw-h2 { font-size: clamp(1.4rem, 1.6vw + 0.9rem, 2rem); font-weight: 600; letter-spacing: -0.024em; line-height: 1.15; }
.cw-intro { margin-top: 10px; color: var(--muted); max-width: 60ch; }
.cw-h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em; }
.cw-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(16px, 2.4vw, 28px); margin-top: 28px; align-items: start; }

/* inputs panel */
.cw-in { padding: clamp(20px, 2.8vw, 34px); border-radius: 24px; background: var(--card); border: 1px solid var(--cw-rule); box-shadow: 0 1px 0 rgba(var(--ink-rgb), 0.04); }
.cw-in__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cw-reset { all: unset; box-sizing: border-box; cursor: pointer; padding: 7px 16px; border-radius: 999px; border: 1.5px solid var(--cw-rule); font-size: 0.86rem; font-weight: 600; color: var(--muted); transition: color 0.2s, border-color 0.2s; }
.cw-reset:hover { color: var(--accent); border-color: var(--accent); }
.cw-reset:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.cw-in__sub { margin-top: 6px; color: var(--muted); font-size: 0.94rem; }
.pg-calc .calc__field { margin: 26px 0 0; padding-top: 22px; border-top: 1px solid var(--cw-rule); }
.cw-in__sub + .calc__field { border-top: 0; padding-top: 0; margin-top: 22px; }
.pg-calc .cw-field__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 12px; }
.pg-calc .cw-field label { font-size: 0.98rem; font-weight: 600; color: var(--ink); letter-spacing: -0.005em; }
.cw-num { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.cw-num input, .cw-more input { width: 96px; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--cw-rule); background: var(--bg); color: var(--ink); font: inherit; font-family: var(--cw-mono); font-size: 1rem; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; transition: border-color 0.2s; -moz-appearance: textfield; appearance: textfield; }
.cw-num input::-webkit-outer-spin-button, .cw-num input::-webkit-inner-spin-button, .cw-more input::-webkit-outer-spin-button, .cw-more input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cw-num input:hover, .cw-more input:hover { border-color: rgba(var(--accent-rgb), 0.55); }
.cw-num input:focus, .cw-more input:focus { border-color: var(--accent); }
.cw-num > span { min-width: 3.6ch; font-family: var(--cw-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
/* 28px tall touch area; the visible bar is the 6px track inside it */
.pg-calc .calc__field input[type="range"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 28px; margin: -11px 0; padding: 0; cursor: pointer; background: transparent; }
.pg-calc .calc__field input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(to right, var(--accent) var(--range-progress, 0%), rgba(var(--ink-rgb), 0.14) var(--range-progress, 0%)); }
.pg-calc .calc__field input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: linear-gradient(to right, var(--accent) var(--range-progress, 0%), rgba(var(--ink-rgb), 0.14) var(--range-progress, 0%)); }
.pg-calc .calc__field input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; margin-top: -9px; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 5px solid var(--accent); box-shadow: 0 2px 8px rgba(var(--ink-rgb), 0.3); transition: box-shadow 0.2s; }
.pg-calc .calc__field input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 5px solid var(--accent); box-shadow: 0 2px 8px rgba(var(--ink-rgb), 0.3); }
.pg-calc .calc__field input[type="range"]:hover::-webkit-slider-thumb { box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0.18), 0 2px 8px rgba(var(--ink-rgb), 0.3); }
.pg-calc .calc__field input[type="range"]:focus-visible { outline-offset: 10px; }
.cw-more { margin-top: 26px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--cw-rule); }
.cw-more summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.cw-more summary::-webkit-details-marker { display: none; }
.cw-more summary::after { content: "+"; font-family: var(--cw-mono); font-size: 1.3rem; color: var(--accent); line-height: 1; transition: transform 0.2s; }
.cw-more[open] summary::after { transform: rotate(45deg); }
.cw-more__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.cw-more label { display: grid; gap: 8px; font-size: 0.86rem; font-weight: 600; }
.cw-more input { width: 100%; text-align: left; }
.cw-more p { margin-top: 12px; color: var(--muted); font-size: 0.9rem; }

/* result panel */
.cw-out { position: sticky; top: 104px; padding: clamp(22px, 3vw, 36px); border-radius: 24px; color: #fff; background: radial-gradient(120% 80% at 100% 0%, #1b4399 0%, transparent 60%), var(--navy); box-shadow: 0 30px 60px -34px rgba(10, 28, 74, 0.7); }
.cw-out__eyebrow { font-family: var(--cw-mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: #8fb4ff; }
.cw-bigwrap { position: relative; margin-top: 14px; }
.cw-big { display: block; font-size: clamp(2.7rem, 4.4vw + 0.6rem, 4.6rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.cw-big--anim { display: none; }
.cw-js .cw-big[data-calc-value] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cw-js .cw-big--anim { display: block; }
.cw-out__label { margin-top: 8px; color: rgba(255, 255, 255, 0.82); }
.cw-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.cw-metrics > div { padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); display: grid; gap: 4px; }
.cw-metrics b { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cw-metrics b span { font-size: 0.9rem; font-weight: 500; color: rgba(255, 255, 255, 0.8); }
.cw-metrics > div > span { font-size: 0.8rem; color: rgba(255, 255, 255, 0.78); line-height: 1.35; }
.cw-bar { margin-top: 26px; height: 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.cw-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #6ea2ff, #bcd4ff); transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.cw-legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 0.78rem; color: rgba(255, 255, 255, 0.78); }
.cw-out__note { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.18); font-size: 0.9rem; color: rgba(255, 255, 255, 0.84); }
.cw-out__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 20px; }
.cw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 12px; font-weight: 600; font-size: 0.95rem; transition: background 0.2s, color 0.2s, transform 0.2s; }
.pg-calc .cw-btn--white { background: #fff; color: var(--navy); }
.pg-calc .cw-btn--white:hover { background: #dbe7ff; transform: translateY(-1px); }
.pg-calc .cw-btn--solid { background: var(--accent-fill, var(--accent)); color: #fff; }
.pg-calc .cw-btn--solid:hover { background: var(--navy); transform: translateY(-1px); }
.cw-out__link { font-weight: 600; font-size: 0.93rem; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255, 255, 255, 0.5); }
.pg-calc .cw-out__link:hover { text-decoration-color: #fff; }

.cw-method { margin-top: clamp(16px, 2.4vw, 28px); padding: 16px 20px; border-radius: 16px; border: 1px solid var(--cw-rule); background: var(--surface); }
.cw-method summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cw-method summary::-webkit-details-marker { display: none; }
.cw-method summary::after { content: "+"; font-family: var(--cw-mono); font-size: 1.4rem; color: var(--accent); line-height: 1; transition: transform 0.2s; }
.cw-method[open] summary::after { transform: rotate(45deg); }
.cw-method p { margin-top: 14px; color: var(--muted); font-size: 0.94rem; max-width: 92ch; }

/* quiet honesty row */
.cw-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 32px); margin-top: clamp(28px, 4vw, 44px); padding-top: 24px; border-top: 1px solid var(--cw-rule); }
.cw-notes li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); font-size: 0.92rem; }
.cw-notes svg { flex: none; width: 24px; height: 24px; margin-top: 1px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 3. CTA ---------- */
.cw-end { padding-bottom: clamp(56px, 8vw, 104px); }
.cw-end__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: clamp(24px, 3vw, 36px); border-top: 2px solid var(--ink); }
.cw-end__inner p { display: grid; gap: 4px; }
.cw-end__inner .cw-mono { color: var(--accent); }
.cw-end__inner strong { font-size: clamp(1.3rem, 1.6vw + 0.8rem, 1.9rem); font-weight: 600; letter-spacing: -0.02em; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .cw-grid { grid-template-columns: 1fr; }
  .cw-out { position: static; }
  .cw-notes { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .pg-calc .cw-field__row { flex-direction: column; align-items: stretch; gap: 10px; }
  .cw-num { justify-content: space-between; }
  .cw-num input { width: 100%; max-width: 160px; }
  .cw-more__row { grid-template-columns: 1fr; }
  .cw-metrics { grid-template-columns: 1fr; }
  .cw-out__actions .cw-btn { width: 100%; }
  .cw-end__inner .cw-btn { width: 100%; }
}
