/* Budgeting resource pages. Uses the brand tokens from src/styles.css. */
.resource { padding: clamp(20px, 4vw, 40px) 0 clamp(56px, 8vw, 96px); }
.resource__container { max-width: 820px; }
.resource-crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0 0 22px; padding: 0; list-style: none; font-size: 0.85rem; color: var(--muted); }
.resource-crumbs li + li::before { content: "/"; margin: 0 8px; color: var(--line-strong); }
.resource-crumbs a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.resource-crumbs a:hover { color: var(--forest); }
.resource__head { margin-bottom: 28px; }
.resource__head .eyebrow { margin-bottom: 14px; }
.resource h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.06; letter-spacing: -0.035em; overflow-wrap: anywhere; }
.resource__lead { margin-top: 16px; font-size: clamp(1.05rem, 2vw, 1.22rem); line-height: 1.55; color: var(--ink-2); max-width: 64ch; }
.resource-meta { margin-top: 14px; font-size: 0.82rem; color: var(--muted); }
.resource__body { font-size: 1.04rem; line-height: 1.7; }
.resource__body > * + * { margin-top: 1em; }
.resource__body h2 { font-size: clamp(1.55rem, 3vw, 2.05rem); line-height: 1.15; margin-top: 1.9em; }
.resource__body h3 { font-size: 1.22rem; margin-top: 1.5em; }
.resource__body p, .resource__body li { max-width: 70ch; }
.resource__body ul, .resource__body ol { padding-left: 1.35em; }
.resource__body li + li { margin-top: 0.45em; }
.resource__body a, .resource-sources a, .resource-related a, .calc-privacy a { color: var(--forest-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.resource__body a:hover, .resource-related a:hover { color: var(--forest); text-decoration-thickness: 2px; }
.resource__body strong { color: var(--ink); }
.callout { padding: 18px 20px; border: 1px solid var(--line); border-left: 4px solid var(--forest-3); border-radius: 14px; background: var(--white); }
.callout--warn { border-left-color: var(--clay); }
.callout > * + * { margin-top: 0.6em; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.resource table { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.resource caption { text-align: left; padding: 12px 14px 4px; font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.resource th, .resource td { padding: 10px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.resource thead th { border-top: 0; background: var(--paper-2); font-size: 0.82rem; letter-spacing: 0.02em; }
.resource td.num, .resource th.num { text-align: right; white-space: nowrap; }
.resource tfoot th, .resource tfoot td { font-weight: 700; background: var(--paper-2); }
/* Calculator */
.calc { margin: 6px 0 36px; padding: clamp(18px, 3vw, 28px); border: 1px solid var(--line); border-radius: 22px; background: var(--white); box-shadow: var(--shadow-sm); }
.calc-privacy { font-size: 0.88rem; color: var(--ink-2); padding: 10px 14px; border-radius: 12px; background: var(--lime-soft); margin-bottom: 18px; }
.calc-nojs { padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 12px; margin-bottom: 16px; }
.calc-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 18px 20px; }
.calc-fields--one { margin-bottom: 14px; }
.calc-debt { margin: 14px 0 0; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 14px; }
.calc-debt legend { padding: 0 6px; font-weight: 700; font-size: 0.9rem; }
.calc-field label { display: block; font-weight: 650; font-size: 0.92rem; line-height: 1.3; }
.calc-hint { font-size: 0.8rem; color: var(--muted); margin-top: 3px; }
.calc-input { position: relative; display: flex; align-items: center; margin-top: 7px; }
.calc-input input, .calc-input select { width: 100%; min-height: 48px; padding: 10px 14px 10px 28px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--paper); color: var(--ink); font: inherit; font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.calc-input select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; font-variant-numeric: normal; }
.calc-input input:focus-visible, .calc-input select:focus-visible { outline: 3px solid var(--forest-3); outline-offset: 2px; border-color: var(--forest-3); }
.calc-input input[aria-invalid="true"], .calc-input select[aria-invalid="true"] { border-color: var(--clay); background-color: #fdf3ef; }
.calc-affix { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.calc-affix--end { left: auto; right: 14px; }
.calc-input:not(:has(.calc-affix:not(.calc-affix--end))) :is(input, select) { padding-left: 14px; }
.calc-error { margin-top: 6px; font-size: 0.84rem; font-weight: 600; color: #8a3a22; }
.calc-error-summary { margin-bottom: 16px; padding: 12px 16px; border: 1.5px solid var(--clay); border-radius: 12px; background: #fdf3ef; }
.calc-error-summary ul { margin: 6px 0 0; padding-left: 1.2em; }
.calc-error-summary a { color: #8a3a22; text-decoration: underline; }
.calc-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); padding-right: 22px; }
.btn--ghost:hover { border-color: var(--forest); }
.calc-results { margin-top: 22px; }
.calc-results__title { font-size: 1.3rem; margin-bottom: 8px; }
.calc-results table { border: 1px solid var(--line); border-radius: 12px; }
.calc-results td strong { font-size: 1.08rem; }
.calc-note { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.calc-example { margin-top: 16px; font-size: 0.92rem; }
.calc-example summary { cursor: pointer; font-weight: 650; }
/* Downloads */
.downloads { display: grid; gap: 14px; margin-top: 12px; }
.download-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.download-card h3 { margin: 0 0 6px; font-size: 1.15rem; }
.download-card .btn { margin-top: 10px; min-height: 44px; }
/* Hubs, related, sources */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; margin-top: 18px; padding: 0; list-style: none; }
.hub-grid li { margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.hub-grid h3, .hub-grid .hub-grid__title { font-size: 1.14rem; margin: 0 0 6px; }
.hub-grid p { font-size: 0.93rem; color: var(--ink-2); }
.resource-sources, .resource-related { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); }
.resource-sources h2, .resource-related h2 { font-size: 1.25rem; margin-bottom: 10px; }
.resource-sources ul, .resource-related ul { margin: 0; padding-left: 1.2em; font-size: 0.92rem; }
.resource-sources li + li, .resource-related li + li { margin-top: 6px; }
.resource-checked { color: var(--muted); }
.cta-panel { margin-top: 40px; padding: 22px 24px; border-radius: 20px; background: var(--forest); color: var(--paper); }
.cta-panel h2 { font-size: 1.45rem; margin: 0 0 8px; color: var(--paper); }
.cta-panel p { color: #dfe8df; }
.cta-panel a { color: var(--lime); text-decoration: underline; text-underline-offset: 3px; }
.site-header--open .menu-toggle > svg { display: none; }
.site-header--open .nav-close-icon { display: inline-flex !important; }
@media print {
  .site-header, .site-footer, .skip-link, .resource-crumbs, .calc-form, .calc-privacy, .resource-related, .cta-panel, .calc-actions { display: none !important; }
  body { background: #fff; }
  .resource { padding: 0; }
  .calc, .table-wrap, .download-card { box-shadow: none; border-color: #999; }
  .calc-example { display: block; }
  .calc-example > table { display: table; }
  table { page-break-inside: avoid; }
  a { color: inherit !important; }
}
.download-alt { display: inline-block; min-height: 24px; padding: 4px 0; margin-left: 12px; font-size: 0.9rem; color: var(--forest-2); text-decoration: underline; text-underline-offset: 3px; }
.downloads-section { margin: 8px 0 32px; }
.preview-hold { margin-bottom: 22px; }

/* Reveal the form before first paint when JavaScript runs, so the page does not
   shift when the calculator module loads (Lighthouse CLS). If the module fails to
   load, its onerror handler removes .calc-js and the no-JS explanation returns. */
.calc-js .calc-form[hidden] { display: block; }
.calc-js #calc-nojs { display: none; }
