:root {
  --paper: #f5f0e6;
  --paper-deep: #ebe2d3;
  --ink: #18251f;
  --muted: #6d756f;
  --green: #123c31;
  --green-light: #1f5b49;
  --coral: #ef775f;
  --yellow: #f3c84b;
  --line: #d8d0c2;
  --white: #fffdf8;
  --radius: 24px;
  --shadow: 0 24px 65px rgba(43, 50, 39, .12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 5%, rgba(243, 200, 75, .2), transparent 22rem),
    linear-gradient(180deg, #f8f4ec 0%, var(--paper) 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input { font: inherit; }

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 28px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 44px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
}

.site-logo img {
  display: block;
  width: auto;
}

.site-links {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  background: rgba(255, 253, 248, .75);
  border: 1px solid rgba(116, 107, 91, .13);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(43, 50, 39, .08);
}

.site-links a,
.hero-actions a {
  color: var(--green);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 800;
}

.site-links a {
  padding: 8px 13px;
  border-radius: 999px;
}

.site-links a:hover,
.site-links a:focus-visible {
  background: var(--paper);
}

.page-header {
  position: relative;
  padding: 0 0 42px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: -.01em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--white);
  background: var(--green);
  border-radius: 10px;
}

.brand-mark svg { width: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

.eyebrow, .step {
  margin: 0 0 14px;
  color: var(--coral);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.eyebrow { display: flex; align-items: center; gap: 9px; }
.eyebrow span { width: 24px; height: 3px; background: var(--coral); border-radius: 9px; }

h1 {
  max-width: 770px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.75rem, 6vw, 5.6rem);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: .94;
}

h1 em { color: var(--green-light); font-weight: 400; }

.intro {
  max-width: 610px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero-actions a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 0 16px;
  background: rgba(255, 253, 248, .72);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.hero-actions a.primary-link {
  color: var(--white);
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 12px 28px rgba(18, 60, 49, .16);
}

.hero-actions a:hover,
.hero-actions a:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(43, 50, 39, .1);
}

.calculator {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(350px, .85fr);
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(116, 107, 91, .13);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.input-panel { padding: 42px 46px 44px; }

.section-heading, .result-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.section-heading { padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.section-heading .step { margin-bottom: 7px; }

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -.035em;
}

.reset-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  color: var(--green);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 99px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 750;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.reset-button:hover { background: var(--paper); border-color: #bdb4a6; transform: translateY(-1px); }
.reset-button svg { width: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 18px;
  padding: 30px 0 29px;
}

.field-wide { grid-column: 1 / -1; }
.field label, fieldset legend { display: block; margin-bottom: 8px; font-size: .76rem; font-weight: 750; letter-spacing: .015em; }

.input-wrap { position: relative; }
.input-wrap input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 42px;
  color: var(--ink);
  background: #faf7f1;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  font-weight: 700;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.input-wrap input:hover { border-color: #b9afa0; }
.input-wrap input:focus { background: var(--white); border-color: var(--green-light); box-shadow: 0 0 0 3px rgba(31, 91, 73, .12); }
.suffix-wrap input { padding-left: 16px; padding-right: 58px; }
.prefix, .suffix { position: absolute; top: 50%; z-index: 1; color: #7a807b; transform: translateY(-50%); pointer-events: none; font-size: .86rem; font-weight: 650; }
.prefix { left: 17px; }
.suffix { right: 16px; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.choice-group { padding: 0 0 25px; }
.timing-group { padding-bottom: 28px; }
.segmented { display: grid; gap: 7px; }
.segmented-four { grid-template-columns: repeat(4, 1fr); }
.segmented-two { grid-template-columns: repeat(2, 1fr); }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.segmented span {
  display: grid;
  min-height: 43px;
  padding: 8px 10px;
  place-items: center;
  color: #656c67;
  background: #f6f1e8;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: .77rem;
  font-weight: 700;
  text-align: center;
  transition: .2s ease;
}
.segmented label:hover span { color: var(--ink); background: #f0eade; }
.segmented input:checked + span { color: var(--white); background: var(--green); border-color: var(--green); box-shadow: 0 5px 13px rgba(18, 60, 49, .15); }
.segmented input:focus-visible + span { outline: 3px solid rgba(239, 119, 95, .45); outline-offset: 2px; }

.info-note {
  display: flex;
  gap: 12px;
  padding: 15px 17px;
  color: #675727;
  background: rgba(243, 200, 75, .18);
  border-left: 3px solid var(--yellow);
  border-radius: 0 9px 9px 0;
}
.info-note svg { flex: 0 0 20px; width: 20px; margin-top: 1px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }
.info-note p { margin: 0; font-size: .78rem; line-height: 1.55; }

.result-panel {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 42px 38px 38px;
  color: var(--white);
  background:
    radial-gradient(circle at 100% 0, rgba(243, 200, 75, .13), transparent 17rem),
    var(--green);
}
.result-panel::after { content: ""; position: absolute; right: -38px; top: 122px; width: 120px; height: 120px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 50%; }
.step-light { color: #f4a594; }
.live-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; color: #cfdfd9; border: 1px solid rgba(255,255,255,.16); border-radius: 99px; font-size: .63rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.live-badge i { width: 6px; height: 6px; background: var(--yellow); border-radius: 50%; box-shadow: 0 0 0 3px rgba(243, 200, 75, .12); }
.result-label { margin: 25px 0 5px; color: #c7d6d1; font-size: .78rem; font-weight: 650; }
.net-amount { position: relative; z-index: 1; margin: 0; color: #fff8e8; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.25rem, 4vw, 3.45rem); font-weight: 500; letter-spacing: -.045em; line-height: 1.12; overflow-wrap: anywhere; }
.net-caption { margin: 8px 0 30px; color: #92ada4; font-size: .72rem; }

.result-breakdown { border-top: 1px solid rgba(255, 255, 255, .13); }
.result-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); font-size: .78rem; }
.result-row span { color: #b9cec7; }
.result-row strong { color: #f9f7ee; font-size: .86rem; white-space: nowrap; }
.accent-row .accent-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; background: var(--yellow); border-radius: 50%; }
.accent-row strong { color: #f5d873; }
.total-row { padding: 18px 0; }
.total-row span, .total-row strong { color: var(--white); font-size: .9rem; }
.deduction-row strong { color: #f0a493; }

.calculation-details { margin-top: auto; padding-top: 30px; }
.calculation-details h3 { margin: 0 0 13px; color: #90aba2; font-size: .65rem; letter-spacing: .14em; text-transform: uppercase; }
.calculation-details dl { margin: 0; }
.calculation-details dl div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; font-size: .69rem; }
.calculation-details dt { color: #89a39a; }
.calculation-details dd { margin: 0; color: #dce6e2; font-weight: 700; text-align: right; }

.content-section {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
  gap: 30px;
  margin-top: 28px;
  padding: 34px;
  background: rgba(255, 253, 248, .74);
  border: 1px solid rgba(116, 107, 91, .13);
  border-radius: 20px;
  box-shadow: 0 16px 45px rgba(43, 50, 39, .08);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.content-grid article,
.faq-list details {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.content-grid h3 {
  margin: 0 0 8px;
  color: var(--green);
  font-size: .96rem;
}

.content-grid p,
.faq-list p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 850;
}

.faq-list details p {
  margin-top: 10px;
}

.page-footer { display: flex; justify-content: space-between; gap: 30px; padding: 24px 4px 0; color: #85857d; font-size: .69rem; }
.page-footer p { max-width: 600px; margin: 0; }
.page-footer span { text-align: right; }
.page-footer a { color: inherit; font-weight: 800; text-decoration: none; }
.page-footer a:hover { color: var(--green); }

.reveal { animation: rise .65s cubic-bezier(.2,.75,.25,1) both; }
.calculator.reveal { animation-delay: .1s; }
.page-footer.reveal { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .calculator { grid-template-columns: 1fr; }
  .result-panel { min-height: 610px; }
  .page-header { padding-bottom: 34px; }
  .brand { margin-bottom: 38px; }
  .content-section,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .page-shell { width: min(100% - 24px, 1180px); padding-top: 20px; }
  .site-nav { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 34px; }
  .site-links { width: 100%; justify-content: space-between; }
  .site-links a { padding-inline: 10px; }
  .page-header { padding: 0 5px 28px; }
  .brand { margin-bottom: 26px; }
  h1 { font-size: clamp(2.55rem, 13vw, 4rem); }
  .intro { font-size: .92rem; }
  .calculator { border-radius: 18px; }
  .input-panel, .result-panel { padding: 30px 22px; }
  .field-grid { grid-template-columns: 1fr; gap: 18px; }
  .field-wide { grid-column: auto; }
  .segmented-four { grid-template-columns: 1fr 1fr; }
  .result-panel { min-height: 580px; }
  .content-section { padding: 24px 20px; border-radius: 16px; }
  .page-footer { flex-direction: column; gap: 8px; }
  .page-footer span { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
