:root {
  --brand: #1d4ed8;
  --brand-light: #dbeafe;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f9fafb;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, sans-serif; color: var(--text); margin: 0; background: #fff; line-height: 1.5; }
header { background: var(--brand); color: #fff; padding-top: 32px; padding-bottom: 32px; padding-left: 20px; padding-right: 20px; }
header a { color: rgba(255,255,255,.9); text-decoration: none; }
header h1 { margin: 12px 0 4px; font-size: 1.8rem; }
header p { color: rgba(255,255,255,.9); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
header .reviewed-badge { color: rgba(255,255,255,.75); font-size: .78rem; margin-top: 6px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
footer p:first-child { max-width: 640px; margin: 0 auto 8px; }
.disclaimer-banner { background: #fef3c7; border-bottom: 1px solid #fde68a; font-size: .9rem; color: #78350f; padding-top: 12px; padding-bottom: 12px; padding-left: 20px; padding-right: 20px; }
main { max-width: 780px; margin: 0 auto; padding: 24px 20px 60px; }
nav.crumbs { max-width: 780px; margin: 0 auto; padding: 12px 20px 0; font-size: .85rem; color: var(--muted); }
nav.crumbs a { color: var(--brand); text-decoration: none; }
form { display: grid; gap: 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; font-weight: 600; }
input, select { padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; }
.toggle-group { display: flex; gap: 8px; flex-wrap: wrap; }
.toggle-group button { flex: 1; min-width: 90px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 600; font-size: .85rem; }
.toggle-group button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.toggle-panel { display: none; }
.toggle-panel.visible { display: grid; gap: 16px; }
button.submit-btn { background: var(--brand); color: #fff; border: none; padding: 12px; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; }
#results-block, #stop-results-block { margin-top: 20px; padding: 20px; background: var(--brand-light); border-radius: var(--radius); display: none; }
#results-block.visible, #stop-results-block.visible { display: block; }
.result-amount { font-size: 2rem; font-weight: 800; margin: 0 0 8px; }
.result-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,.08); font-size: .95rem; }
.result-row:last-child { border-bottom: none; }
.privacy-note { font-size: .8rem; color: var(--muted); margin-top: 8px; }
section { margin-top: 40px; }
main > section { overflow-x: auto; }
.site-nav { margin-top: 6px; font-size: .85rem; }
.site-nav a { color: rgba(255,255,255,.85); text-decoration: none; margin-right: 4px; }
.site-nav a:hover { text-decoration: underline; }
footer { color: var(--muted); font-size: .8rem; padding: 32px 20px 24px; border-top: 1px solid var(--border); }
.footer-groups { max-width: 780px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; text-align: left; }
.footer-heading { font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; color: var(--text); margin: 0 0 8px; }
.footer-groups ul { list-style: none; padding: 0; margin: 0; }
.footer-groups li { margin-bottom: 6px; }
.footer-groups a { color: var(--muted); text-decoration: none; font-size: .85rem; }
.footer-groups a:hover { color: var(--brand); }
.footer-legal { max-width: 780px; margin: 24px auto 0; text-align: center; border-top: 1px solid var(--border); padding-top: 16px; }
.formula-section { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: var(--radius); padding: 24px; overflow-x: auto; }
.formula-section .source-line { color: #64748b; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.formula-section table, main > section > table { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 12px 0; }
.formula-section th, .formula-section td, main > section > table th, main > section > table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.formula-code { background: #1e3a5f; color: #e2e8f0; border-radius: 8px; padding: 16px 18px; font-family: 'Courier New', monospace; font-size: .82rem; line-height: 1.9; }
.formula-footnote { font-size: .78rem; color: #94a3b8; margin-top: 12px; }
.source-range-note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 14px 16px; font-size: .85rem; color: #78350f; margin: 16px 0; }
.tool-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; list-style: none; padding: 0; }
.tool-links a { display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 600; font-size: .9rem; }
.tool-links a:hover { border-color: var(--brand); }
.symbol-table-wrap { overflow-x: auto; }
/* affiliate widget */
.provider-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.provider-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--text); display: block; }
.provider-card:hover { border-color: var(--brand); }
.provider-card .provider-name { font-weight: 700; margin-bottom: 6px; }
.provider-card .provider-blurb { font-size: .85rem; color: var(--muted); }
.affiliate-disclosure { font-size: .78rem; color: var(--muted); margin-top: 10px; }
@media (min-width: 641px) {
  header { text-align: center; }
}
@media (max-width: 640px) {
  header h1 { font-size: 1.4rem; }
  h2 { font-size: 1.15rem; }
  h3 { font-size: 1rem; }
  .formula-code { padding: 12px 14px; line-height: 1.6; font-size: .78rem; }
  .disclaimer-banner { font-size: .8rem; }
  .result-amount { font-size: 1.6rem; }
  footer { font-size: .78rem; }
}
