:root {
  --bg: #f6f7f2;
  --surface: #ffffff;
  --surface-2: #eef4f0;
  --ink: #19201d;
  --muted: #66736d;
  --line: #d9e0da;
  --green: #1d7a50;
  --green-dark: #14583a;
  --amber: #c8872a;
  --blue: #2f62b3;
  --coral: #b85242;
  --shadow: 0 18px 45px rgba(25, 32, 29, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: var(--green-dark);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 48px);
  background: rgba(246, 247, 242, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

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

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.95rem;
}

.nav a,
.site-footer a {
  color: var(--ink);
  text-decoration: none;
}

.nav a:hover,
.site-footer a:hover {
  color: var(--green);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(520px, 1.45fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
  padding: clamp(32px, 5vw, 68px) clamp(18px, 4vw, 48px) 42px;
}

.hero-copy {
  position: sticky;
  top: 90px;
  min-width: 0;
  padding-top: 8px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.45rem, 5vw, 5.1rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 16px;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.lead {
  max-width: 680px;
  margin: 20px 0 22px;
  color: var(--muted);
  font-size: 1.13rem;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trust-strip span {
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.calculator-shell,
.benchmark,
.content-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.calculator-shell {
  min-width: 0;
  padding: clamp(16px, 2.5vw, 28px);
}

.calculator-head,
.benchmark,
.action-row,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.calculator-head {
  margin-bottom: 18px;
}

.calculator-grid {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

fieldset {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

legend {
  padding: 0 6px;
  font-weight: 800;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #cdd7d0;
  border-radius: 8px;
  font: inherit;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(29, 122, 80, 0.24);
  outline-offset: 2px;
}

button {
  min-height: 42px;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.primary-button {
  color: white;
  background: var(--green);
}

.primary-button:hover {
  background: var(--green-dark);
}

.secondary-button,
.ghost-button {
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.ghost-button {
  background: transparent;
}

.results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.result-card {
  min-height: 144px;
  padding: 16px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.result-card span,
.result-card small {
  display: block;
  color: var(--muted);
}

.result-card strong {
  display: block;
  margin: 8px 0;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.2vw, 1.95rem);
  line-height: 1.05;
}

.result-card.accent {
  border-color: rgba(29, 122, 80, 0.35);
  background: #eef7f2;
}

.verdict {
  margin: 14px 0;
  padding: 14px 16px;
  border-left: 4px solid var(--green);
  background: #f1f7f3;
  border-radius: 8px;
  color: var(--green-dark);
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: var(--surface);
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: var(--surface-2);
}

.action-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 16px;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.preset-button {
  min-height: 38px;
  padding: 8px 11px;
  color: var(--green-dark);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.preset-button:hover {
  color: #ffffff;
  background: var(--green);
}

.method-notes {
  margin-top: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.method-notes details {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.method-notes summary {
  font-weight: 800;
  cursor: pointer;
}

.method-notes p {
  margin: 8px 0 0;
  color: var(--muted);
}

.disclaimer {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.benchmark,
.content-section {
  margin: 20px clamp(18px, 4vw, 48px);
  padding: clamp(20px, 3vw, 34px);
}

.benchmark-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: min(100%, 440px);
  padding: 16px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.benchmark-card span,
.benchmark-card small {
  display: block;
  color: var(--muted);
}

.benchmark-card strong {
  display: block;
  margin: 4px 0;
  font-size: 1.4rem;
}

.three-col,
.five-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.five-list {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.three-col article,
.five-list article,
.split article {
  padding: 18px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.page-grid article,
.callout {
  padding: 18px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quick-calculator {
  border-color: rgba(47, 98, 179, 0.22);
}

.quick-calculator form {
  margin-top: 18px;
}

.quick-calc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.standalone-calc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.calculator-mode-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 6px;
  padding: 6px;
  background: #f2f5f1;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calculator-mode-switch label {
  margin: 0;
}

.calculator-mode-switch select {
  min-height: 46px;
  background: #ffffff;
}

[data-show-modes][hidden] {
  display: none !important;
}

[data-show-pay-types][hidden] {
  display: none !important;
}

input[aria-invalid="true"] {
  border-color: var(--coral);
  outline: 2px solid rgba(187, 68, 48, 0.14);
}

.result-emphasis {
  border-color: rgba(47, 98, 179, 0.42);
  box-shadow: inset 0 3px 0 var(--blue);
}

.locum-input-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.gross-income-field {
  max-width: 360px;
  margin: 18px 0;
}

.deduction-table {
  min-width: 1500px;
  font-size: 0.88rem;
}

.deduction-table th,
.deduction-table td {
  vertical-align: top;
}

.deduction-table input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
}

.deduction-table input[type="number"] {
  min-width: 120px;
}

.noscript-note {
  padding: 12px;
  color: var(--coral);
  background: #fff7f5;
  border: 1px solid #edc6bf;
  border-radius: 8px;
}

.quick-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.quick-result {
  min-height: 116px;
  padding: 16px;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quick-result span,
.quick-result small {
  display: block;
  color: var(--muted);
}

.quick-result strong {
  display: block;
  margin: 8px 0;
  color: var(--blue);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.05;
}

.longtail-hero {
  margin-top: clamp(24px, 4vw, 48px);
}

.longtail-hero .lead {
  max-width: 860px;
}

.related-tools h3 a {
  color: var(--ink);
  text-decoration: none;
}

.related-tools h3 a:hover {
  color: var(--green);
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.sources ul {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}

.last-updated {
  color: var(--muted);
}

.faq details {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.faq summary {
  font-weight: 800;
  cursor: pointer;
}

.site-footer {
  margin-top: 34px;
  padding: 28px clamp(18px, 4vw, 48px);
  background: var(--ink);
  color: white;
}

.site-footer p {
  margin: 6px 0 0;
  color: #c7d2cc;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer a {
  color: white;
}

.conversion-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.conversion-heading h2,
.conversion-heading p,
.validation-form h3,
.recommendation-module h3 {
  margin-top: 0;
}

.conversion-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.validation-form,
.recommendation-module {
  min-width: 0;
}

.conversion-grid.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.validation-unavailable {
  max-width: 680px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.validation-unavailable p {
  margin-bottom: 0;
  color: var(--muted);
}

.validation-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.validation-form {
  display: grid;
  gap: 12px;
}

.validation-form p,
.recommendation-module p {
  margin-bottom: 0;
  color: var(--muted);
}

.consent-label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  font-weight: 500;
}

.consent-label input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.form-note,
.form-status {
  margin: 0;
  font-size: 0.86rem;
}

.form-status {
  min-height: 1.4em;
  font-weight: 700;
}

.form-status[data-status="success"] {
  color: var(--green-dark);
}

.form-status[data-status="info"] {
  color: var(--muted);
}

.form-status[data-status="error"] {
  color: var(--coral);
}

.recommendation-module {
  padding-left: 22px;
  border-left: 4px solid var(--blue);
}

.recommendation-module ul {
  display: grid;
  gap: 14px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.recommendation-module li {
  display: grid;
  gap: 3px;
}

.recommendation-module a {
  font-weight: 800;
}

.recommendation-module span {
  color: var(--muted);
  font-size: 0.92rem;
}

.professional-help {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.professional-help summary {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
}

.professional-help form {
  margin-top: 18px;
}

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

.report-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 24px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.report-dialog::backdrop {
  background: rgba(25, 32, 29, 0.62);
}

.report-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.report-dialog-head h3 {
  margin: 0;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 1.5rem;
}

.report-preview {
  max-height: 420px;
  margin-top: 18px;
  padding: 16px;
  overflow: auto;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.report-preview p {
  margin: 0 0 8px;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    position: static;
  }

  .five-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .site-header,
  .site-footer,
  .benchmark {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .calculator-grid,
  .results,
  .three-col,
  .page-grid,
  .quick-calc-grid,
  .standalone-calc-grid,
  .calculator-mode-switch,
  .quick-result-grid,
  .locum-input-groups,
  .conversion-grid,
  .help-form-grid,
  .split,
  .five-list {
    grid-template-columns: 1fr;
  }

  .conversion-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .recommendation-module {
    padding-top: 18px;
    padding-left: 0;
    border-top: 4px solid var(--blue);
    border-left: 0;
  }

  .calculator-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .benchmark-card {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 2.35rem;
  }

  .hero,
  .benchmark,
  .content-section {
    margin-left: 12px;
    margin-right: 12px;
  }

  .hero {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media print {
  .site-header,
  .site-footer,
  .no-print,
  .longtail-hero .action-row {
    display: none !important;
  }

  body,
  .content-section,
  .quick-result,
  .deduction-table {
    color: #000000;
    background: #ffffff;
    box-shadow: none;
  }

  .content-section {
    margin: 0;
    border: 0;
  }

  .deduction-table-wrap {
    overflow: visible;
  }

  .deduction-table {
    min-width: 0;
    font-size: 8pt;
  }

  .deduction-table a {
    color: #000000;
  }
}
