/* Calculator UI — extends styles.css */
.prose-wide { max-width: 880px; }
.calc {
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 22px 24px 8px;
  margin: 8px 0 32px;
}
.calc fieldset { border: none; margin: 0 0 14px; padding: 0; min-width: 0; }
.calc legend { font-family: var(--serif); font-size: 17px; font-weight: 600; margin: 0 0 10px; padding: 0; color: var(--ink); }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 18px; }
.calc label { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink-soft); margin-bottom: 4px; }
.calc .hint { display: block; font-size: 12px; color: var(--ink-soft); font-weight: 400; margin-top: 3px; line-height: 1.4; }
.calc input[type="number"], .calc input[type="date"], .calc input[type="text"], .calc select {
  width: 100%; font: inherit; font-size: 16px; padding: 9px 10px; border: 1px solid #C9C3B6; border-radius: 3px;
  background: #fff; color: var(--ink);
}
.calc input:focus, .calc select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.calc .iw { position: relative; display: block; }
.calc .money input { padding-left: 24px; }
.calc .money .iw::before { content: "$"; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); font-size: 15px; pointer-events: none; }
.calc .pctwrap input { padding-right: 28px; }
.calc .pctwrap .iw::after { content: "%"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); font-size: 15px; pointer-events: none; }
.calc .check { display: flex; align-items: center; gap: 8px; margin-top: 26px; font-size: 14.5px; color: var(--ink); }
.calc .check input { width: 18px; height: 18px; accent-color: var(--accent); }
.calc .actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 6px 0 12px; font-size: 13px; color: var(--ink-soft); }
.calc button, .btn {
  font: inherit; font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 3px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
}
.calc button.secondary { background: transparent; color: var(--accent); }
.calc button:hover { background: var(--accent-soft); color: #fff; }

/* Results */
.results { margin: 0 0 32px; }
.results .headline {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 0 0 18px;
}
.stat { background: #fff; border: 1px solid var(--rule); border-top: 3px solid var(--accent); padding: 14px 16px; }
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); margin-bottom: 6px; }
.stat .value { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }
.stat .sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.4; }
.stat.warn { border-top-color: #A4452B; }
.stat.warn .value { color: #A4452B; }
.stat.good { border-top-color: var(--accent-soft); }
.results table { font-size: 14.5px; margin: 14px 0 20px; }
.results td.num, .results th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.results tr.total td { font-weight: 600; border-top: 2px solid var(--ink); }
.results .note { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.results .bar { height: 10px; background: #E6E1D6; border-radius: 5px; overflow: hidden; display: flex; margin: 6px 0 4px; }
.results .bar span { display: block; height: 100%; }
.results .legend { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 13px; color: var(--ink-soft); }
.results .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.c-fed { background: #0F4C3A; } .c-state { background: #2E6B57; } .c-fica { background: #7FA394; } .c-net { background: #D9D2C3; }

.cta-slot {
  margin: 28px 0; padding: 18px 22px; border: 1px dashed var(--rule); background: #fff; font-size: 15px; line-height: 1.55;
}
.cta-slot strong { font-family: var(--serif); }
.assumptions { font-size: 14px; color: var(--ink-soft); }
.assumptions li { margin-bottom: 6px; }
.nojs { background: #FFF4E5; border: 1px solid #F0C98A; padding: 12px 16px; font-size: 14.5px; margin: 0 0 24px; }
.js .nojs { display: none; }

@media (max-width: 560px) {
  .calc { padding: 16px 14px 4px; }
  .calc-grid { grid-template-columns: 1fr; gap: 12px; }
  .stat .value { font-size: 22px; }
  .results table { display: block; overflow-x: auto; white-space: nowrap; }
}

.calc textarea { width: 100%; font: inherit; font-size: 15px; padding: 9px 10px; border: 1px solid #C9C3B6; border-radius: 3px; background: #fff; color: var(--ink); min-height: 110px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.presets-table td:first-child { font-weight: 600; }
