/* page-fitcheck.css — the tool, its live ledger, and the result. A working instrument:
   its form fields and tables keep their lines (data-ui). */


.tool { padding-block: clamp(2rem, 6vw, 5rem) clamp(4rem, 8vw, 7rem); min-height: calc(100svh - var(--head-h)); scroll-margin-top: var(--head-h); }
.tool__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
.tool__main { grid-column: 1 / span 7; }
.tool__intro .lead { margin-top: 1.25rem; }
.tool__intro .note { margin-top: 1rem; }
.tool__noscript { margin-top: 2rem; padding: 1rem 1.25rem; background: var(--paper-2); border-radius: var(--r-sm); }

/* ---------- questions ---------- */
.fc { margin-top: clamp(2rem, 4vw, 3rem); }
.fc-rail { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; font-size: var(--step-small); margin-bottom: 2rem; }
.fc-rail li { padding-top: 0.6rem; border-top: 6px solid var(--paper-2); border-radius: 3px; color: color-mix(in srgb, var(--ink) 62%, transparent); transition: border-color var(--t-ui) ease, color var(--t-ui) ease; }
.fc-rail li.is-done { border-color: var(--accent); }
.fc-rail li.is-on { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.fc-step { display: none; }
.fc-step.is-on { display: block; animation: step-in 200ms var(--ease-out) both; }
.fc-step:focus { outline: none; }
@keyframes step-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fc fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.fc-ask { display: block; font-family: var(--font-display); font-size: var(--step-figure); line-height: 1.1; letter-spacing: -0.02em; font-weight: 500; padding: 0; max-width: 22ch; }
.fc-why { margin-top: 0.85rem; max-width: 52ch; }
.fc-choices { display: grid; gap: 0.6rem; margin-top: 1.75rem; }
.fc-choice, .fc-pill { position: relative; display: flex; align-items: center; gap: 0.85rem; cursor: pointer; background: #fff; border: 1.5px solid rgba(22, 32, 28, 0.2); transition: border-color var(--t-hover) ease, background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.fc-choice { padding: 1rem 1.15rem; min-height: 3.5rem; border-radius: var(--r-sm); }
.fc-choice input, .fc-pill input { position: absolute; opacity: 0; pointer-events: none; }
.fc-choice::before { content: ''; flex: none; width: 1.15rem; height: 1.15rem; border-radius: 50%; border: 1.5px solid currentColor; transition: box-shadow var(--t-hover) ease, background-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .fc-choice:hover, .fc-pill:hover { border-color: var(--ink); } }
.fc-choice:active, .fc-pill:active { transform: scale(0.985); }
.fc-choice:has(input:checked) { border-color: var(--evergreen); background: color-mix(in srgb, var(--evergreen) 8%, #fff); }
.fc-choice:has(input:checked)::before { background: var(--evergreen); border-color: var(--evergreen); outline: 3px solid #fff; outline-offset: -5px; }
.fc-choice:has(input:focus-visible), .fc-pill:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.fc-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.fc-pill { padding: 0 1.25rem; min-height: 3rem; font-weight: 600; border-radius: 999px; }
.fc-pill:has(input:checked) { background: var(--evergreen); color: var(--paper); border-color: var(--evergreen); }
.fc-sub { margin-top: 1.75rem !important; }
.fc-sub legend { font-weight: 600; }
.fc-money { margin-top: 1.5rem; max-width: 20rem; }
.fc-money .input { font-size: var(--step-lead); min-height: 3.75rem; }
.fc-tuck { margin-top: 1.5rem; }
.fc-mini { display: block; font-weight: 600; margin-top: 1rem; }
.fc-tuck .fc-money { margin-top: 0.6rem; }
.fc-check { display: inline-flex; align-items: center; gap: 0.65rem; margin-top: 1rem; min-height: 2.75rem; cursor: pointer; font-weight: 500; }
.fc-check input { width: 1.25rem; height: 1.25rem; accent-color: var(--evergreen); }
.fc-money .input:disabled { opacity: 0.45; }
.fc-soft { margin-top: 1rem; max-width: 52ch; font-weight: 500; }
.fc-soft:empty { display: none; }
.fc-soft:not(:empty) { padding: 0.75rem 1rem; background: var(--gap-soft); border-radius: var(--r-sm); }
.fc-warn { min-height: 1.6em; margin-top: 1.25rem; font-weight: 600; color: var(--ink); }
.fc-warn:not(:empty)::before { content: ''; display: inline-block; width: 0.6em; height: 0.6em; margin-right: 0.5em; background: var(--evergreen); vertical-align: 0.05em; }
.fc-now { display: none; }
.fc-nav { display: flex; align-items: center; gap: 1.25rem; }

/* ---------- the live panel ---------- */
.panel { grid-column: 9 / span 4; position: sticky; top: calc(var(--head-h) + 1.5rem); background: #fff; color: var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-lift); padding: clamp(1.25rem, 2vw, 1.75rem); }
.panel__toggle { display: none; }
.panel__h { font-size: var(--step-lead); line-height: 1.15; }
.bars { margin-top: 1.5rem; display: grid; gap: 1.1rem; }
.bar { display: grid; grid-template-columns: 1fr auto; row-gap: 0.4rem; }
.bar__name { font-weight: 500; }
.bar__amt { font-size: var(--step-small); opacity: 0.7; }
.bar.is-ready .bar__amt { opacity: 1; font-weight: 600; font-size: var(--step-body); }
.bar__track { grid-column: 1 / -1; height: 10px; background: var(--paper-2); overflow: hidden; border-radius: 999px; }
.bar__fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; transform: scaleX(0); transform-origin: left; transition: transform 240ms var(--ease-out); }
.panel__total { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 2px solid currentColor; font-family: var(--font-display); font-size: var(--step-lead); max-width: none; }
.panel__total .amt { font-weight: 600; }
.panel .note { margin-top: 1rem; }

@media (max-width: 60rem) {
  .tool__main { grid-column: 1 / -1; padding-bottom: 4.5rem; }
  .panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; padding: 0; transition: transform 300ms var(--ease-out); box-shadow: 0 -12px 28px -16px rgba(0, 0, 0, 0.5); /* taste-skill-ignore: the sheet floats over the page */ }
  .panel__toggle { display: flex; width: 100%; justify-content: space-between; align-items: center; min-height: 3.75rem; padding: 0 var(--margin); font-weight: 600; }
  .panel__toggle::after { content: ''; width: 1rem; height: 1rem; margin-left: 0.75rem; background: currentColor; -webkit-mask: var(--i-up) center / contain no-repeat; mask: var(--i-up) center / contain no-repeat; transition: transform var(--t-ui) var(--ease-out); }
  .panel.is-open .panel__toggle::after { transform: rotate(180deg); }
  .panel__mini { margin-left: auto; }
  .panel__body { display: none; padding: 0 var(--margin) 1.25rem; max-height: 60svh; overflow-y: auto; }
  .panel.is-open .panel__body { display: block; }
  .panel.is-away { transform: translateY(110%); }
  .panel__h { display: none; }
  .bars { margin-top: 0.5rem; }
  .fc-rail li { font-size: 0; padding-top: 0; }
  .fc-rail { margin-bottom: 0.6rem; }
  .fc-now { display: block; font-size: var(--step-small); font-weight: 600; margin-bottom: 1.5rem; }
  .tool__intro .note { display: none; }
  .panel.is-done { transform: translateY(110%); }
  html:has(.panel:not(.is-done)) { scroll-padding-bottom: 5rem; }
}

/* ---------- the result ---------- */
.fc-out__title { font-size: var(--step-lead); scroll-margin-top: calc(var(--head-h) + 1rem); }
.fc-out__title:focus { outline: none; }
.fc-out__total { margin-top: 0.5rem; max-width: none; }
.fc-figure { display: inline-block; font-family: var(--font-display); font-weight: 800; font-size: var(--step-display); line-height: 1; letter-spacing: -0.045em; font-variant-numeric: tabular-nums lining-nums; }
@media (prefers-reduced-motion: no-preference) {
  .fc-figure.is-in { animation: figure-in 700ms var(--ease-out) both; }
  .fc-derive tbody { animation: step-in 600ms var(--ease-out) both; animation-delay: calc(300ms + var(--i, 0) * 140ms); }
}
/* the gap is the one brass thing on the page */
.fc-figure.is-gap { background: var(--brass); color: var(--ink); padding: 0.02em 0.16em 0.06em; border-radius: 0.14em; }
.fc-figure.is-covered { color: var(--good); }
.fc-out__sub { margin-top: 0.75rem; max-width: 52ch; font-weight: 500; }
.fc-def { margin-top: 1rem; }
.fc-def summary { cursor: pointer; font-weight: 600; min-height: 2.75rem; display: flex; align-items: center; }
.fc-def p { margin-top: 0.5rem; max-width: 60ch; }
.fc-cover { margin-top: 1.5rem; }
.fc-cover thead th { font-size: var(--step-small); font-weight: 600; }
.fc-cover .money { display: inline-block; width: min(10rem, 100%); }
.fc-cover .input { min-height: 2.75rem; padding-block: 0.35rem; text-align: right; }
.fc-cover td[data-gap].is-covered { color: var(--good); font-weight: 600; }
.fc-cover tfoot td, .fc-cover tfoot th { font-size: var(--step-body); }
.fc-first { margin-top: clamp(2rem, 4vw, 3rem); padding: 1.25rem 1.5rem; background: var(--sage); border-radius: var(--r-md); }
.fc-first p { margin-top: 0.5rem; max-width: 60ch; }
@media (max-width: 40rem) {
  .fc-cover thead { display: none; }
  .fc-cover tr { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; padding: 0.75rem 0; border-bottom: 1px solid color-mix(in srgb, currentColor 18%, transparent); }
  .fc-cover th, .fc-cover td { border: 0; padding: 0; }
  .fc-cover td[data-need]::before { content: 'needed '; font-weight: 400; opacity: 0.8; }
  .fc-cover td[data-gap]::before { content: 'gap '; font-weight: 400; opacity: 0.8; }
  .fc-cover td[data-need], .fc-cover td[data-gap] { grid-column: 2; text-align: right; }
  .fc-cover .fc-cover__in { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  .fc-cover .money { width: 100%; }
  .fc-cover tfoot th, .fc-cover tfoot td { border: 0; padding: 0; font-family: var(--font-display); font-size: var(--step-lead); }
  .fc-cover tfoot tr { border-bottom: 0; border-top: 2px solid currentColor; padding-top: 1rem; }
  .fc-cover tfoot td:nth-of-type(1), .fc-cover tfoot td:nth-of-type(2) { display: none; }
  .fc-cover tfoot td:last-child { grid-column: 2; grid-row: 1; }
}
@keyframes figure-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fc-out .note { margin-top: 0.75rem; }
.fc-remark { margin-top: 1.75rem; max-width: 52ch; }
.fc-out__h { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.fc-derive { margin-top: 1rem; }
.fc-derive .head th { padding-top: 1.5rem; font-family: var(--font-display); font-size: var(--step-lead); font-weight: 500; border-bottom-width: 2px; }
.fc-derive .nil { opacity: 0.6; }
.fc-derive .sum th, .fc-derive .sum td.amt { font-weight: 600; }
.fc-derive .run th, .fc-derive .run td { background: var(--paper-2); }
.fc-derive .run th { padding-left: 0.6rem; }
.fc-derive .run td.amt { padding-right: 0.6rem; }
.fc-derive tfoot td.expr { font-family: var(--font-text); font-size: var(--step-small); font-weight: 400; }
.fc-held p { margin-top: 0.75rem; max-width: 52ch; }
.fc-assume { margin-top: 2.5rem; border-top: 1.5px solid rgba(22, 32, 28, 0.2); border-bottom: 1.5px solid rgba(22, 32, 28, 0.2); }
.fc-assume summary { cursor: pointer; padding: 1rem 0; font-weight: 600; min-height: 3rem; }
.fc-assume ul { list-style: none; margin: 0; padding: 0 0 1rem; display: grid; gap: 0.5rem; }
.fc-assume li { display: flex; justify-content: space-between; gap: 1rem; font-size: var(--step-small); }
.fc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: 2.5rem; }
.fc-copied { min-height: 1.5em; }
.fc-copied.is-raw { white-space: pre-wrap; font-variant-numeric: tabular-nums; }

/* ---------- method and close ---------- */
.method { padding-block: clamp(4.5rem, 9vw, 8rem); }
.method__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 2.5rem; }
.method__intro { grid-column: 1 / span 5; }
.method__intro .lead { margin-top: 1.5rem; }
.method__table { grid-column: 7 / span 6; align-self: start; }
.method__table thead th { font-size: var(--step-small); font-weight: 600; }
.method__note { grid-column: 7 / span 6; }
.fc-close { padding-block: clamp(5rem, 10vw, 9rem); }
.fc-close h2 { max-width: 16ch; }
.method__pic { margin-top: 2rem; aspect-ratio: 4 / 3; }
@media (max-width: 60rem) { .method__intro, .method__table, .method__note { grid-column: 1 / -1; } }

@media print {
  .tool__intro, .fc, .panel, .method, .fc-close, .fc-held input, .fc-mini { display: none !important; }
  .fc-assume[open], .fc-assume { display: block; }
  .tool__main { grid-column: 1 / -1; }
}

/* the coverage ring: what is already held, as a share of what is indicated */
.fc-out__head { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.fc-ring { position: relative; width: 132px; height: 132px; flex: none; }
.fc-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.fc-ring__track { stroke: var(--sage); }
.fc-ring__fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 900ms var(--ease-out); }
.fc-ring__pct { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 1.75rem; letter-spacing: -0.03em; line-height: 1; }
.fc-ring__pct small { display: block; font-family: var(--font-text); font-size: 0.75rem; font-weight: 700; color: var(--muted); letter-spacing: 0; margin-top: 0.25rem; }
