:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #5d6965;
  --paper: #f4f1e9;
  --surface: #fffef9;
  --line: #d6ddd7;
  --green: #173f35;
  --green-soft: #dfebe3;
  --accent: #def36c;
  --danger: #a12d2d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); }
a { color: inherit; text-underline-offset: 4px; }
button, input { font: inherit; }
.wide { width: min(1100px, calc(100% - 28px)); margin-inline: auto; }
.skip-link { position: fixed; top: 12px; left: 14px; z-index: 10; transform: translateY(-160%); padding: 8px 12px; border: 2px solid var(--ink); border-radius: 8px; background: #fff; }
.skip-link:focus { transform: translateY(0); }

.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-inner { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { font-weight: 750; letter-spacing: -.02em; text-decoration: none; }
.header-inner span { color: var(--muted); font-size: .88rem; }

.hero { display: grid; gap: 26px; padding-block: 58px 38px; }
.eyebrow { margin: 0 0 10px; color: var(--green); font-size: .76rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 20px; font-size: clamp(2.8rem, 9vw, 6rem); font-weight: 680; line-height: .96; letter-spacing: -.06em; }
h2 { margin-bottom: 13px; font-size: clamp(1.55rem, 4vw, 2.35rem); font-weight: 650; line-height: 1.1; letter-spacing: -.035em; }
h3 { margin-bottom: 7px; font-size: 1.04rem; }
.lead { max-width: 710px; margin-bottom: 0; color: #3d4a46; font-size: clamp(1.05rem, 2vw, 1.24rem); }
.privacy-note { max-width: 420px; padding: 20px; border: 1px solid #b8cabe; border-radius: 17px; background: var(--green-soft); }
.privacy-note p { margin: 5px 0 0; color: #3f4e48; }

.tool-shell { display: grid; gap: 16px; align-items: start; padding-bottom: 70px; }
.input-card, .output-card { padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.section-heading > p:last-child { color: var(--muted); }
.field-grid { display: grid; gap: 13px; margin-top: 24px; }
label { display: grid; gap: 6px; color: #35423e; font-size: .9rem; font-weight: 680; }
.money-field { display: flex; align-items: center; min-height: 50px; overflow: hidden; border: 1px solid #aebbb4; border-radius: 11px; background: #fff; }
.money-field > span { padding-left: 13px; color: var(--muted); }
input { width: 100%; min-width: 0; padding: 12px 13px 12px 8px; border: 0; outline: 0; background: transparent; color: var(--ink); }
.money-field:focus-within { outline: 3px solid #cbd99b; outline-offset: 2px; }
input[aria-invalid="true"] { color: var(--danger); }
.field-error { margin: 16px 0 0; color: var(--danger); font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
button, .cta { min-height: 46px; padding: 11px 15px; border: 2px solid var(--ink); border-radius: 10px; font-weight: 710; cursor: pointer; }
button.primary { background: var(--ink); color: #fff; }
button.secondary { border-color: var(--green); background: var(--green); color: #fff; }
button.quiet { background: transparent; color: var(--ink); }
button:hover, .cta:hover { filter: brightness(1.08); }
button:focus-visible, a:focus-visible { outline: 3px solid #7859ff; outline-offset: 3px; }

.output-card { background: var(--green); color: #fff; }
.inverse-heading .eyebrow, .inverse-heading > p:last-child { color: #dce9e3; }
.results { margin: 22px 0 0; }
.results > div { display: grid; gap: 6px; padding: 16px 0; border-top: 1px solid rgba(255,255,255,.2); }
.results dt { color: #dce9e3; }
.results dt small { font-size: .77rem; }
.results dd { margin: 0; }
.results output { font-size: 1.35rem; font-weight: 730; letter-spacing: -.02em; }
.results output[data-tone="negative"] { color: #ffd0c9; }
.result-note { margin: 16px 0 0; padding: 13px; border-radius: 11px; background: rgba(255,255,255,.09); color: #dce9e3; font-size: .86rem; }

.explanation { padding-block: 68px; border-top: 1px solid var(--line); }
.explanation-grid { display: grid; gap: 12px; margin-top: 25px; }
.explanation-grid article { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.explanation-grid p { margin: 0; color: var(--muted); }
.scope-note { margin-top: 16px; padding: 20px; border-left: 4px solid var(--green); background: var(--green-soft); }
.scope-note p { margin: 5px 0 0; color: #3f4e48; }
.next-step { display: grid; gap: 28px; margin-bottom: 68px; padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.next-step p { color: var(--muted); }
.cta { display: inline-block; border-color: var(--accent); background: var(--accent); color: var(--ink); text-decoration: none; }
.next-step nav { display: grid; align-content: center; gap: 11px; }
.site-footer { padding-block: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }
.site-footer p { margin: 0; }

@media (min-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1.6fr) minmax(280px, .7fr); align-items: end; padding-block: 82px 50px; }
  .tool-shell { grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr); }
  .input-card, .output-card { padding: 28px; }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results > div { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .results dd { text-align: right; }
  .explanation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .next-step { grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); padding: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
