/* The estimator. Every control is at least 44px tall for thumbs. */
.tool { margin-top: 1rem; }
.tool-fallback { color: var(--muted); }
.banner { display: flex; gap: .75rem; align-items: flex-start; background: var(--amber-soft); border: 1px solid #fde68a; color: var(--amber); border-radius: 12px; padding: 10px 12px; font-size: .88rem; margin-bottom: 1rem; }
.banner p { margin: 0; flex: 1; }
.banner button { background: none; border: 0; color: var(--amber); font-size: 1.4rem; line-height: 1; cursor: pointer; min-width: 44px; min-height: 44px; margin: -8px -8px -8px 0; }

.progress { list-style: none; display: flex; justify-content: space-between; padding: 0; margin: 0 0 .5rem; }
.progress li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .2rem; font-size: .75rem; color: var(--muted); }
.progress .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: #f1f5f9; color: var(--text); }
.progress .done .dot, .progress .current .dot { background: var(--blue); color: #fff; }
.progress .current .dot { box-shadow: 0 0 0 4px #dbeafe; }
.progress .current { color: var(--blue); font-weight: 600; }
.bar { height: 6px; background: #f1f5f9; border-radius: 99px; overflow: hidden; margin-bottom: 1.25rem; }
.bar span { display: block; height: 100%; background: var(--blue); border-radius: 99px; transition: width .4s; }

.card h2 { margin-top: 0; }
.card h2:focus { outline: none; }
.sub { color: var(--muted); margin: 0 0 1.25rem; font-size: .92rem; }
.field { border: 0; padding: 0; margin: 0 0 1.5rem; min-width: 0; }
.field legend, .field label, .label-text { font-weight: 600; color: var(--ink); font-size: .92rem; padding: 0; }
.label-row { display: flex; align-items: center; gap: .4rem; justify-content: space-between; }
.label-row > :first-child { flex: 1; }
.hint { color: var(--muted); font-size: .82rem; margin: .2rem 0 .5rem; }
.help { position: relative; flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--rule); background: #fff; color: var(--muted); font-weight: 700; font-size: .8rem; cursor: pointer; }
/* The circle stays small; the tap area around it is 44px. */
.help::before { content: ''; position: absolute; inset: -9px; }
.row .help::before { inset: -11px; }
.help:hover { color: var(--blue); border-color: var(--blue); }

.input-wrap { position: relative; }
.input-wrap.narrow { max-width: 160px; }
.prefix, .suffix { position: absolute; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.prefix { left: 14px; } .suffix { right: 14px; font-size: .85rem; }
.amount, select { width: 100%; min-height: 48px; border: 2px solid var(--rule); border-radius: 12px; font: 600 1.05rem var(--sans); color: var(--ink); padding: 10px 14px; background: #fff; }
.has-prefix .amount { padding-left: 30px; }
.has-suffix .amount { padding-right: 52px; }
.amount.big { font-size: 1.25rem; }
.amount:focus, select:focus { outline: none; border-color: var(--blue); }
.range { width: 100%; margin-top: .6rem; accent-color: var(--blue); height: 28px; }

.choices { display: grid; gap: .6rem; }
.choices.two { grid-template-columns: 1fr; }
.choices.kids { grid-template-columns: repeat(4, 56px); }
.choice { min-height: 52px; border: 2px solid var(--rule); background: #fff; border-radius: 12px; font: 600 .95rem var(--sans); color: var(--text); cursor: pointer; text-align: left; padding: 0 16px; }
.kids .choice { text-align: center; padding: 0; font-size: 1.1rem; }
.choice[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }
.kids .choice[aria-pressed="true"] { background: var(--blue); color: #fff; }

.note { background: #f1f5f9; border-radius: 12px; padding: 12px 14px; }
.note p { margin: .1rem 0; }
.note-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.note-value { font-size: 1.6rem; font-weight: 700; color: var(--ink); }
.note.good { background: var(--green-soft); color: var(--green); }
.found { color: var(--green); font-weight: 600; font-size: .88rem; margin: -1rem 0 1.25rem; }
.field .found { margin: .3rem 0 0; }

.switch-row { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; border: 2px solid var(--rule); border-radius: 12px; padding: 12px 14px; margin-bottom: 1.5rem; }
.switch { flex: none; width: 52px; height: 30px; border-radius: 99px; border: 0; background: #cbd5e1; position: relative; cursor: pointer; margin-top: 4px; }
.switch span { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--blue); }
.switch[aria-checked="true"] span { transform: translateX(22px); }
.finder { border-top: 1px solid var(--rule); padding-top: 1rem; }
.credit { display: flex; justify-content: space-between; align-items: center; gap: .5rem; border: 1px solid var(--rule); background: #f8fafc; border-radius: 12px; padding: 10px 12px; margin-bottom: .5rem; font-size: .9rem; color: var(--muted); }
.credit.yes { background: var(--green-soft); color: var(--green); border-color: #a7f3d0; }

.nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.nav button, .danger { min-height: 48px; padding: 0 24px; border-radius: 12px; font: 700 .95rem var(--sans); cursor: pointer; border: 2px solid transparent; }
.primary { background: var(--blue); color: #fff; }
.primary:hover { background: var(--blue-dark); }
.secondary { background: #fff; border-color: var(--rule) !important; color: var(--text); }
.secondary:disabled { opacity: .35; cursor: default; }
.dark { background: #1e293b; color: #fff; }

.summary { background: var(--head); color: #fff; border-radius: var(--radius); padding: 22px; margin-bottom: 1rem; }
.summary p { margin: 0; }
.summary-label { color: #bfdbfe; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.summary-big { font-size: 2.6rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.summary-sub { color: #93c5fd; font-size: .9rem; margin-bottom: 1rem !important; }
.summary-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.summary-tiles div { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.summary-tiles small { color: #bfdbfe; font-size: .72rem; }
.summary-tiles b { font-size: 1.3rem; }
.summary-credits { margin-top: .75rem !important; display: flex; justify-content: space-between; background: rgba(16, 185, 129, .2); border-radius: 10px; padding: 8px 12px; font-size: .85rem; }

.grid2 { display: grid; gap: 1rem; margin-bottom: 1rem; }
.card .panel { margin-bottom: 1rem; padding: 16px; }
.card .panel h3 { margin-top: 0; }
.donut { width: 180px; height: 180px; display: block; margin: .5rem auto; }
.legend { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .85rem; }
.legend li { display: flex; align-items: center; gap: .5rem; padding: .15rem 0; }
.legend b { margin-left: auto; color: var(--ink); }
.swatch { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.breakdown .section { font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: .9rem 0 .2rem; }
.row { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; padding: .45rem 0; border-bottom: 1px solid #f1f5f9; font-size: .88rem; }
.row > div { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .35rem; }
.row small { flex-basis: 100%; color: var(--muted); font-size: .75rem; }
.row b { font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.row .help { width: 22px; height: 22px; font-size: .7rem; }
.row.total { border-top: 2px solid var(--rule); border-bottom: 0; font-weight: 700; }
.credit-amt { color: var(--green) !important; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .5rem 0; }
.tile { background: #f8fafc; border: 1px solid var(--rule); border-radius: 12px; padding: 8px; text-align: center; display: flex; flex-direction: column; }
.tile small { font-size: .7rem; color: var(--muted); }
.tile b { color: var(--ink); }
.tile.good { background: var(--green-soft); } .tile.good b { color: var(--green); }
.quarters { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.quarter { background: #f8fafc; border: 1px solid var(--rule); border-radius: 12px; padding: 10px; text-align: center; display: flex; flex-direction: column; font-size: .78rem; }
.quarter b:first-child { color: var(--blue); }
.quarter b:last-child { font-size: 1rem; color: var(--ink); margin-top: .2rem; }
.quarter small { color: var(--muted); }
.quarters:has(.passed) .quarter:not(.passed) { border-color: var(--blue); background: var(--blue-soft); }
.quarter.passed span { color: var(--muted); }
.cal { margin-top: .75rem; }
.cal-btn { min-height: 44px; padding: 0 18px; border-radius: 12px; border: 2px solid var(--rule); font: 700 .9rem var(--sans); cursor: pointer; }
.cal-btn:hover { border-color: var(--blue) !important; color: var(--blue-dark); }
.cal .hint { margin-top: .4rem; }
.safe { border-top: 1px solid var(--rule); margin-top: 1.25rem; padding-top: 1rem; }
.safe h4 { margin: 0 0 .25rem; color: var(--ink); font-size: 1rem; }
.safe .note { margin-top: .75rem; }
.clear { text-align: center; margin: 1.25rem 0; }
.danger { background: var(--red); color: #fff; width: 100%; }
.sources { font-size: .78rem; color: var(--muted); text-align: center; }

.help-dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(520px, calc(100% - 32px)); box-shadow: 0 20px 50px rgba(15, 23, 42, .3); }
.help-dialog::backdrop { background: rgba(15, 23, 42, .5); }
.help-dialog form { padding: 22px; }
.help-dialog h3 { margin-top: 0; }
.help-dialog p { font-size: .92rem; }
.eyebrow { color: var(--blue); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin: 0; }
.help-dialog button { min-height: 44px; padding: 0 20px; border-radius: 12px; font-weight: 700; cursor: pointer; border: 2px solid var(--rule); background: #fff; }

/* Mini calculators on the guide pages (src/client/mini.js). */
.mini { margin: 1.25rem 0 1.5rem; }
.mini-card h2 { margin-top: 0; }
.mini-result { border-top: 1px solid var(--rule); padding-top: 1rem; margin-bottom: .75rem; }
.mini-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; margin: 0; }
.mini-big { font-size: 2.2rem; font-weight: 800; color: var(--ink); line-height: 1.2; margin: .1rem 0 .4rem; font-variant-numeric: tabular-nums; }
.mini-basis { background: var(--amber-soft); color: var(--amber); border-radius: 12px; padding: 10px 12px; font-size: .85rem; margin: .5rem 0 0; }
.mini-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 1rem 0 .5rem; }
.mini-cta { display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; border-radius: 12px; background: var(--blue); color: #fff; font-weight: 700; text-decoration: none; }
.mini-cta:hover { background: var(--blue-dark); color: #fff; }
.mini-clear { min-height: 44px; padding: 0 8px; background: none; border: 0; color: var(--muted); font: 600 .88rem var(--sans); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.mini-clear:hover { color: var(--red); }
.mini-foot .found { margin: 0; flex-basis: 100%; }
.mini .tile small + b + small { margin-top: .1rem; }

/* One-line insights (src/client/insights.js): the sentence, then the working. */
.insights { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.insight { background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--blue); border-radius: 12px; padding: 10px 14px; }
.insight.action { border-left-color: var(--green); }
.insight.new { border-left-color: #b45309; }
.insight p { margin: .1rem 0; color: var(--ink); font-weight: 600; font-size: .95rem; }
.insight .insight-how { color: var(--muted); font-weight: 400; font-size: .8rem; }
.insight-kind { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

/* Weekly set-aside tracker (src/client/tracker.js). */
.track-row { display: grid; gap: 0 .75rem; }
.track-form .field { margin-bottom: 1rem; }
.track-add { min-height: 48px; padding: 0 32px; border: 0; border-radius: 12px; font: 700 .95rem var(--sans); cursor: pointer; }
.track-form .found { margin: .6rem 0 0; }
.tracker-sum h3 { margin: 1.25rem 0 .25rem; }
.qbar { display: block; flex-basis: 100%; height: 6px; margin-top: .35rem; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.qbar span { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.link-del { flex: none; min-height: 44px; padding: 0 4px; background: none; border: 0; color: var(--muted); font: 600 .8rem var(--sans); text-decoration: underline; cursor: pointer; }
.link-del:hover { color: var(--red); }
.track-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 .5rem; }
.check { display: flex; gap: .5rem; align-items: center; min-height: 44px; font-size: .92rem; color: var(--ink); }
.check input { width: 20px; height: 20px; accent-color: var(--blue); }
.file-btn { display: inline-flex; align-items: center; background: var(--paper); color: var(--text); }
@media (min-width: 520px) { .track-row { grid-template-columns: 1fr 1fr; } }

/* Year-end summary (src/client/summary.js). */
.sum-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.sum-head { margin: 0 0 .5rem; font-size: .9rem; }
.sum-sheet h2 { font-size: 1.05rem; margin: 1.25rem 0 .4rem; }
.sum-wrap { overflow-x: auto; }
.sum-table { width: 100%; min-width: 560px; border-collapse: collapse; table-layout: fixed; font-size: .84rem; }
.sum-table .c-line { width: 27%; } .sum-table .c-amt { width: 14%; } .sum-table .c-how { width: 40%; } .sum-table .c-form { width: 19%; }
.sum-table th { text-align: left; background: #f1f5f9; color: var(--ink); padding: .4rem .5rem; }
.sum-table td { padding: .4rem .5rem; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.sum-table td.num { text-align: right; white-space: nowrap; }
@media print {
  .site-head, .site-foot, .no-print, .sum-tools, .mini-basis, ins.adsbygoogle { display: none !important; }
  body { background: #fff; }
  .sum-sheet { border: 0; box-shadow: none; padding: 0; }
  .sum-wrap { overflow: visible; }
  .sum-table { min-width: 0; font-size: 9.5pt; }
  .sum-table tr { break-inside: avoid; }
}

@media (max-width: 639px) {
  /* The summary step holds its own panels; drop the outer box so they are not boxed twice. */
  .card[data-step="4"] { padding: 4px 0 0; border: 0; background: none; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bar span, .switch span { transition: none; }
}
@media (min-width: 640px) {
  .choices.two { grid-template-columns: 1fr 1fr; }
  .quarters { grid-template-columns: repeat(4, 1fr); }
  .summary-big { font-size: 3.2rem; }
}
@media (min-width: 900px) {
  .card[data-step="4"] .grid2 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .step-label { display: none; }
}
