/* Beat inflation calculator: a four-step flow */
.bi-hero { margin: 40px 0 22px; text-align: center; }
.bi-hero h1 { max-width: 16ch; margin: 14px auto 0; font-size: clamp(2.2rem, 6vw, 4.2rem); line-height: 1.04; letter-spacing: -.05em; }
.bi-hero .tagline { margin: 16px auto 0; max-width: 52ch; }

.bi-shell { --accent: var(--green); position: relative; margin: 0 auto; max-width: 880px; padding: clamp(18px, 4vw, 40px); border: 1px solid var(--line); border-radius: 28px; background: rgb(var(--c-s1-rgb) / .92); box-shadow: 0 26px 90px rgb(0 0 0 / calc(.32 * var(--c-shadow-k))); scroll-margin-top: 16px; }
.bi-shell *, .bi-shell { min-width: 0; }
.bi-shell button { font: inherit; }
.bi-shell :focus-visible { outline: 2px solid var(--c-green-line); outline-offset: 3px; }
/* Fields never light up their box when focused: the caret is the cue. */
.bi-shell input:focus, .bi-shell input:focus-visible { outline: none; }
.bi-shell input { caret-color: var(--c-green-text); }

/* Tactile feedback: a press-in on touch/click and a soft pop when a choice registers. */
.bi-card, .bi-chip, .bi-next, .bi-back, .bi-ghost, .bi-summary-chip, .bi-compare button, .bi-progress button { -webkit-tap-highlight-color: transparent; transition: transform .12s ease, border-color .15s, background .15s; }
.bi-card:active, .bi-chip:active, .bi-next:active, .bi-back:active, .bi-ghost:active, .bi-summary-chip:active, .bi-compare button:active { transform: scale(.97); }
@keyframes biPop { 0% { transform: scale(.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
.bi-tapped { animation: biPop .28s cubic-bezier(.2,.8,.3,1); }
@media (prefers-reduced-motion: reduce) { .bi-tapped { animation: none; } .bi-card:active, .bi-chip:active, .bi-next:active { transform: none; } }

/* ---- progress ---- */
.bi-progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.bi-progress button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 40px; padding: 6px 4px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 800; font-size: .88rem; cursor: pointer; }
.bi-progress button span { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); font-size: .78rem; }
.bi-progress button:disabled { cursor: default; color: var(--c-subtle); }
.bi-progress button:disabled span { border-style: dashed; }
.bi-progress button:not(:disabled):hover { color: var(--text); }
.bi-progress button.is-done span { border-color: var(--c-green-line); background: rgb(var(--c-green-rgb) / .1); color: var(--c-green-text); }
.bi-progress button.is-current { color: var(--text); }
.bi-progress button.is-current span { border-color: var(--c-green-line); background: var(--c-green); color: var(--c-on-brand); }
.bi-progress-bar { height: 3px; margin: 10px 0 0; border-radius: 3px; background: rgb(var(--c-ink-rgb) / .08); overflow: hidden; }
.bi-progress-bar i { display: block; height: 100%; width: calc(var(--progress, 0) * 100%); background: linear-gradient(90deg, var(--c-green), var(--c-blue)); transition: width .35s cubic-bezier(.2,.8,.3,1); }

.bi-summary { display: flex; flex-wrap: wrap; gap: 6px; min-height: 8px; margin: 14px 0 0; }
.bi-summary:empty { margin-top: 6px; }
.bi-summary-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: rgb(var(--c-ink-rgb) / .04); color: var(--c-text-2); font-weight: 700; font-size: .82rem; cursor: pointer; }
.bi-summary-chip span { color: var(--muted); font-size: .75rem; }
.bi-summary-chip:hover { border-color: rgb(var(--c-ink-rgb) / .4); }

/* ---- panes ---- */
.bi-pane { margin-top: 22px; }
@media (prefers-reduced-motion: reduce) { .bi-progress-bar i { transition: none; } }
.bi-stage { position: relative; }

/* ---- live meter: sticks to the top and keeps running across every step ---- */
.bi-meter { position: sticky; top: 8px; z-index: 5; display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 12px 14px 12px 16px; border: 1px solid rgb(var(--c-green-rgb) / .38); border-radius: 18px; background: radial-gradient(circle at 0% 0%, rgb(var(--c-green-rgb) / .13), transparent 55%), rgb(var(--c-s2-rgb)); box-shadow: 0 12px 34px rgb(0 0 0 / calc(.38 * var(--c-shadow-k))); transition: border-color .4s, background .4s; }
.bi-meter.is-losing { border-color: rgb(var(--c-red-rgb) / .42); background: radial-gradient(circle at 0% 0%, rgb(var(--c-red-rgb) / .13), transparent 55%), rgb(var(--c-s2-rgb)); }
.bi-meter-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c-green); box-shadow: 0 0 12px rgba(56,217,138,.9); animation: biPulse 2s ease-in-out infinite; transition: background .4s, box-shadow .4s; }
.bi-meter.is-losing .bi-meter-dot { background: var(--c-red); box-shadow: 0 0 12px rgba(255,77,109,.9); }
.bi-meter-main { flex: 1; min-width: 0; }
.bi-meter-label { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-weight: 800; font-size: .7rem; letter-spacing: .05em; line-height: 1.35; text-transform: uppercase; }
.bi-meter-value { display: block; margin-top: 2px; font-size: clamp(1.45rem, 4.6vw, 2.3rem); line-height: 1.05; letter-spacing: -.035em; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--c-green-text); transition: color .4s; overflow-wrap: anywhere; }
.bi-meter.is-losing .bi-meter-value { color: var(--c-red-text); }
.bi-meter small { display: block; margin-top: 3px; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.bi-meter small b { color: var(--c-text-2); }
.bi-meter-reset { flex: none; min-height: 38px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgb(var(--c-ink-rgb) / .04); color: var(--c-text-2); font-weight: 800; font-size: .84rem; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .12s ease, border-color .15s; }
.bi-meter-reset:hover { border-color: rgb(var(--c-ink-rgb) / .4); }
.bi-meter-reset:active { transform: scale(.95); }
.bi-pane h2 { margin: 0; font-size: clamp(1.5rem, 3.6vw, 2.2rem); letter-spacing: -.035em; line-height: 1.12; outline: none; }
.bi-help { margin: 6px 0 16px; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.bi-help strong { color: var(--text); }
.bi-insight { margin: 16px 0 0; padding: 12px 14px; border-left: 3px solid var(--c-blue-line); border-radius: 0 12px 12px 0; background: rgb(var(--c-blue-rgb) / .07); color: var(--c-text-3); font-size: .92rem; line-height: 1.55; }
.bi-insight:empty { display: none; }
.bi-noscript { color: var(--muted); }
.bi-noscript a { color: var(--c-green-text); text-decoration: underline; }

/* amount */
.bi-amount { display: flex; align-items: center; gap: 10px; padding: 8px 20px; border: 1px solid rgb(var(--c-ink-rgb) / .22); border-radius: 20px; background: rgb(var(--c-sink-rgb) / .3); cursor: text; }
.bi-amount > span { color: var(--c-green-text); font-weight: 900; font-size: clamp(1.8rem, 5vw, 2.6rem); }
.bi-amount input { flex: 1; width: 100%; min-width: 0; padding: 6px 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 900; letter-spacing: -.035em; font-variant-numeric: tabular-nums; outline: none; -moz-appearance: textfield; appearance: textfield; }
.bi-amount input::-webkit-outer-spin-button, .bi-amount input::-webkit-inner-spin-button, .bi-edit-field input::-webkit-outer-spin-button, .bi-edit-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bi-chips, .bi-horizon { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.bi-chip { min-height: 42px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: rgb(var(--c-ink-rgb) / .04); color: var(--c-text-2); font-weight: 800; font-size: .93rem; cursor: pointer; transition: border-color .15s, background .15s; }
.bi-chip:hover { border-color: rgb(var(--c-ink-rgb) / .4); }
.bi-chip[aria-pressed="true"] { border-color: var(--c-green-line); background: rgb(var(--c-green-rgb) / .16); color: var(--c-text); }

/* option cards */
.bi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 10px; }
.bi-card { position: relative; display: grid; gap: 3px; align-content: start; min-height: 96px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 16px; background: rgb(var(--c-ink-rgb) / .035); color: var(--c-text-2); text-align: left; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.bi-card:hover { border-color: rgb(var(--c-ink-rgb) / .4); transform: translateY(-1px); }
.bi-card:is([aria-pressed="true"], [data-selected="true"]) { border-color: var(--c-green-line); background: rgb(var(--c-green-rgb) / .12); }
.bi-card:is([aria-pressed="true"], [data-selected="true"])::after { content: "✓"; position: absolute; top: 10px; right: 12px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--c-green); color: var(--c-on-brand); font-size: .75rem; font-weight: 900; }
.bi-card strong { font-size: 1.5rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bi-card > span { font-weight: 800; font-size: .9rem; line-height: 1.3; }
.bi-card small { color: var(--muted); font-size: .76rem; }
.bi-card em { margin-top: 4px; font-style: normal; font-weight: 800; font-size: .78rem; }
.bi-card em.is-up { color: var(--c-green-text); }
.bi-card em.is-down { color: var(--c-red-text); }
.bi-card-edit { cursor: text; }
.bi-edit-field { display: flex; align-items: baseline; gap: 0; padding-right: 26px; }
.bi-edit-field input { width: 4ch; max-width: 100%; min-width: 0; padding: 0; border: 0; border-bottom: 1px dashed rgb(var(--c-ink-rgb) / .35); background: transparent; color: var(--text); font: inherit; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; outline: none; -moz-appearance: textfield; appearance: textfield; }
.bi-edit-field b { font-size: 1.5rem; font-weight: 800; }

/* ---- nav ---- */
.bi-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.bi-nav > :only-child, .bi-back[hidden] + .bi-next { margin-left: auto; }
.bi-next { min-height: 48px; padding: 10px 26px; border: 0; border-radius: 999px; background: var(--c-green); color: var(--c-on-brand); font-weight: 900; font-size: 1rem; cursor: pointer; transition: filter .15s; }
.bi-next:hover { filter: brightness(1.1); }
.bi-back { min-height: 48px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--c-text-2); font-weight: 800; cursor: pointer; }
.bi-back:hover { border-color: rgb(var(--c-ink-rgb) / .4); }
[data-restart] { margin-left: auto; }

/* ---- results ---- */
.bi-results-title { font-size: clamp(1.35rem, 3.4vw, 2rem) !important; }
.bi-results-title em { font-style: normal; color: var(--c-green-text); }
.bi-results.is-losing .bi-results-title em { color: var(--c-red-text); }
.bi-hero-number { margin-top: 18px; padding: clamp(18px, 4vw, 28px); border: 1px solid rgb(var(--c-green-rgb) / .4); border-radius: 22px; background: radial-gradient(circle at 50% 0%, rgb(var(--c-green-rgb) / .14), transparent 60%), rgb(var(--c-bg-rgb) / .6); text-align: center; }
.bi-results.is-losing .bi-hero-number { border-color: rgb(var(--c-red-rgb) / .42); background: radial-gradient(circle at 50% 0%, rgb(var(--c-red-rgb) / .14), transparent 60%), rgb(var(--c-bg-rgb) / .6); }
.bi-hero-number > span { display: block; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; }
.bi-hero-number > span b { color: var(--text); }
.bi-hero-number strong { display: block; margin-top: 8px; font-size: clamp(2.2rem, 8vw, 4.4rem); line-height: 1; letter-spacing: -.05em; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--c-green-text); overflow-wrap: anywhere; }
.bi-results.is-losing .bi-hero-number strong { color: var(--c-red-text); }
.bi-hero-number small { display: block; margin-top: 10px; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.bi-hero-number small b { color: var(--c-text-2); }

.bi-chart { margin-top: 16px; }
.bi-chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.bi-chart-legend span::before { content: ""; display: inline-block; width: 14px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.bi-chart-legend .is-pick::before { background: var(--c-green); }
.bi-results.is-losing .bi-chart-legend .is-pick::before { background: var(--c-red); }
.bi-chart-legend .is-cash::before { background: var(--c-orange); }
.bi-chart-legend .is-base::before { height: 0; border-top: 2px dashed rgb(var(--c-ink-rgb) / .4); }
.bi-chart-plot { height: clamp(150px, 28vw, 220px); margin-top: 10px; border-radius: 14px; background: rgb(var(--c-ink-rgb) / .025); }
.bi-chart-plot svg { display: block; width: 100%; height: 100%; }
.bi-chart-plot path { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.bi-chart-pick { stroke: var(--c-green-line); }
.bi-chart-pick.is-down { stroke: var(--c-red-line); }
.bi-chart-cash { stroke: var(--c-orange-line); stroke-width: 2 !important; opacity: .85; }
.bi-chart-base { stroke: rgb(var(--c-ink-rgb) / .35); stroke-width: 1.5; stroke-dasharray: 5 5; }
.bi-chart-axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: .76rem; font-weight: 700; }

.bi-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.bi-stats > div { padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: rgb(var(--c-ink-rgb) / .03); }
.bi-stats span { display: block; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; }
.bi-stats strong { display: block; margin-top: 6px; font-size: clamp(1.15rem, 2.6vw, 1.5rem); letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bi-stats small { display: block; margin-top: 4px; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.bi-stats small b { color: var(--c-text-2); }

@keyframes biPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .bi-meter-dot { animation: none; } }

.bi-takeaways { margin-top: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: rgb(var(--c-ink-rgb) / .025); }
.bi-takeaways h3 { margin: 0 0 8px; font-size: 1.05rem; }
.bi-takeaways ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--c-text-3); font-size: .92rem; line-height: 1.55; }
.bi-takeaways strong, .bi-takeaways b { color: var(--text); }

.bi-section-title { margin: 26px 0 0; font-size: 1.15rem; letter-spacing: -.02em; }
.bi-compare { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.bi-compare button { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid transparent; border-radius: 12px; background: rgb(var(--c-ink-rgb) / .03); color: var(--c-text-2); text-align: left; cursor: pointer; }
.bi-compare button:hover { border-color: var(--line); }
.bi-compare button[aria-pressed="true"] { border-color: var(--c-green-line); background: rgb(var(--c-green-rgb) / .08); }
.bi-compare-name { font-weight: 800; font-size: .9rem; line-height: 1.25; }
.bi-compare-name small { display: block; color: var(--muted); font-weight: 700; font-size: .74rem; }
.bi-compare-bar { position: relative; height: 10px; border-radius: 5px; background: rgb(var(--c-ink-rgb) / .06); }
.bi-compare-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 5px; }
.bi-compare-bar i.is-up { background: linear-gradient(90deg, rgb(var(--c-green-rgb) / .5), var(--c-green)); }
.bi-compare-bar i.is-down { background: linear-gradient(90deg, rgb(var(--c-red-rgb) / .5), var(--c-red)); }
.bi-compare-bar b { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: rgb(var(--c-ink-rgb) / .7); border-radius: 1px; }
.bi-compare-value { font-weight: 900; font-variant-numeric: tabular-nums; font-size: .95rem; text-align: right; }
.bi-compare-value.is-up, .bi-table td.is-up { color: var(--c-green-text); }
.bi-compare-value.is-down, .bi-table td.is-down { color: var(--c-red-text); }

.bi-table-wrap { margin-top: 10px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.bi-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .9rem; }
.bi-table th, .bi-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.bi-table thead th { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.bi-table th:first-child { text-align: left; }
.bi-table tbody tr:last-child th, .bi-table tbody tr:last-child td { border-bottom: 0; }

.bi-results-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.bi-ghost { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--c-text-2); font-weight: 800; font-size: .88rem; cursor: pointer; }
.bi-ghost:hover { border-color: rgb(var(--c-ink-rgb) / .4); }

.bi-answer { max-width: 880px; margin: 34px auto 0; padding: clamp(18px, 4vw, 32px); border: 1px solid var(--line); border-radius: 24px; background: rgb(var(--c-s2-rgb) / .82); }
.bi-answer h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.9rem); letter-spacing: -.03em; }
.bi-answer-lead { margin: 10px 0 14px; color: var(--c-text-3); line-height: 1.6; }
.bi-answer-lead strong { color: var(--text); }
.bi-answer-table caption { caption-side: bottom; padding: 10px 12px; color: var(--muted); font-size: .8rem; text-align: left; line-height: 1.5; }
.bi-answer-table tbody th { white-space: normal; }
.bi-answer-table tbody th small { display: block; color: var(--muted); font-weight: 600; font-size: .72rem; }
.bi-answer .bi-help { margin: 12px 0 0; font-size: .82rem; }
.bi-answer + .calculator-education, .bi-shell + .calculator-education { margin-top: 34px; }

@media (max-width: 640px) {
  .bi-shell { border-radius: 22px; }
  .bi-progress button { flex-direction: column; gap: 3px; font-size: .72rem; }
  .bi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .bi-card { min-height: 88px; padding: 12px; }
  .bi-card strong, .bi-edit-field input, .bi-edit-field b { font-size: 1.25rem; }
  .bi-stats { grid-template-columns: 1fr; }
  .bi-compare button { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .bi-compare-bar { grid-column: 1 / -1; grid-row: 2; }
  .bi-table th, .bi-table td { padding: 9px 8px; font-size: .82rem; }
  .bi-next { flex: 1; }
  .bi-meter { top: 6px; gap: 10px; padding: 10px 12px; }
  .bi-meter-reset { min-height: 34px; padding: 6px 11px; font-size: .78rem; }
  .bi-meter small span[data-m="per"] { display: none; }
  .bi-answer-table th, .bi-answer-table td { white-space: normal; }
  .bi-horizon { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .bi-horizon .bi-chip { padding: 8px 4px; font-size: .84rem; }
}
