:root {
  color-scheme: light;
  --ink: #17251f;
  --muted: #65736c;
  --green: #0d6245;
  --green-dark: #084d36;
  --mint: #dcefe5;
  --paper: #fffefa;
  --canvas: #f1f4ef;
  --line: #d7ded9;
  --focus: #c88925;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, rgba(13, 98, 69, 0.12), transparent 30rem),
    var(--canvas);
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(100% - 2rem, 72rem);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5.5rem) 0 2rem;
}

.hero {
  max-width: 48rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.eyebrow,
.step {
  margin: 0 0 0.7rem;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 46rem;
  margin-bottom: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.intro {
  max-width: 40rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.7;
}

.intro strong {
  display: block;
  margin-top: 0.75rem;
  margin-bottom: 0.2rem;
  color: var(--ink);
}

.intro-overview {
  display: block;
}

.calculator,
.results {
  overflow: hidden;
  border: 1px solid rgba(23, 37, 31, 0.1);
  border-radius: 1.25rem;
  background: var(--paper);
  box-shadow: 0 1.2rem 3rem rgba(36, 50, 43, 0.08);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.5rem, 4vw, 2.4rem);
  border-bottom: 1px solid var(--line);
}

h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -0.025em;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.period-selector legend {
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.segmented-control {
  display: flex;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--canvas);
}

.segmented-control label {
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: block;
  padding: 0.65rem 1rem;
  border-radius: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.segmented-control input:checked + span {
  color: white;
  background: var(--green);
  box-shadow: 0 0.2rem 0.55rem rgba(13, 98, 69, 0.2);
}

.segmented-control input:focus-visible + span {
  outline: 3px solid rgba(200, 137, 37, 0.45);
  outline-offset: 2px;
}

.pay-form {
  padding: clamp(1.5rem, 4vw, 2.4rem);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem;
}

.hours-warning {
  margin: 1rem 0 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid #e1bd74;
  border-radius: 0.65rem;
  color: #6f4b0b;
  background: #fff7df;
  font-size: 0.82rem;
  line-height: 1.45;
}

.hours-warning::before {
  content: "⚠ ";
  font-weight: 800;
}

.field {
  display: grid;
  gap: 0.55rem;
  color: var(--ink);
  font-size: 0.93rem;
  font-weight: 700;
}

.field.full-width {
  grid-column: 1 / -1;
}

.field.full-width .input-wrap {
  max-width: calc(50% - 0.675rem);
}

.field small,
.exemptions > p,
.check-card small,
.calculation-row small,
.gross-total small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.45;
}

.input-wrap {
  display: flex;
  align-items: center;
  min-height: 3.35rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: white;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.select-wrap {
  position: relative;
  display: flex;
}

.select-wrap::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 1rem;
  color: var(--green);
  font-size: 1.15rem;
  font-weight: 800;
  pointer-events: none;
  transform: translateY(-58%);
}

.select-wrap select {
  width: 100%;
  min-height: 3.35rem;
  padding: 0.85rem 2.8rem 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  outline: 0;
  color: var(--ink);
  background: white;
  appearance: none;
  cursor: pointer;
  font-weight: 650;
}

.select-wrap select:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(13, 98, 69, 0.12);
}

.input-wrap:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(13, 98, 69, 0.12);
}

.input-wrap > span {
  color: var(--muted);
  font-weight: 600;
}

.currency > span {
  padding-left: 1rem;
}

.suffix > span {
  padding-right: 1rem;
  font-size: 0.8rem;
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1rem;
  font-weight: 650;
}

.input-wrap input::placeholder {
  color: #a0aaa5;
}

.exemptions,
.other-deductions {
  margin-top: 2.2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.td1-options {
  margin-top: 2.2rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #f7f8f4;
}

.td1-options summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  cursor: pointer;
  list-style: none;
}

.td1-options summary::-webkit-details-marker {
  display: none;
}

.td1-options summary::after {
  content: "+";
  color: var(--green);
  font-size: 1.35rem;
  font-weight: 700;
}

.td1-options[open] summary::after {
  content: "−";
}

.td1-options summary > span {
  display: grid;
  gap: 0.15rem;
}

.td1-options summary small,
.td1-content p {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.45;
}

.td1-content {
  padding: 1.1rem;
  border-top: 1px solid var(--line);
  background: white;
}

.td1-content > p:first-child {
  max-width: 45rem;
  margin-bottom: 1rem;
}

.td1-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.td1-limit {
  margin: 0.9rem 0 0;
}

.input-wrap input:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: #eef1ed;
}

.exemptions legend,
.other-deductions legend {
  margin-bottom: 0.35rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
}

.exemptions > p,
.other-deductions p {
  margin-bottom: 1rem;
}

.other-deductions-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.other-deductions-heading p {
  margin: 0;
}

.add-deduction,
.remove-deduction {
  border: 0;
  cursor: pointer;
  font-weight: 750;
}

.add-deduction {
  flex: 0 0 auto;
  padding: 0.7rem 0.9rem;
  border-radius: 0.6rem;
  color: white;
  background: var(--green);
}

.add-deduction:hover {
  background: var(--green-dark);
}

.add-deduction:focus-visible,
.remove-deduction:focus-visible {
  outline: 3px solid rgba(200, 137, 37, 0.45);
  outline-offset: 2px;
}

.custom-deduction-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.custom-deduction-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 0.45fr) auto;
  gap: 0.65rem;
  align-items: center;
}

.custom-deduction-row input {
  width: 100%;
  min-width: 0;
  min-height: 2.9rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  outline: 0;
  color: var(--ink);
  background: white;
}

.custom-deduction-row input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(13, 98, 69, 0.12);
}

.amount-edit {
  position: relative;
}

.amount-edit::before {
  content: "$";
  position: absolute;
  top: 50%;
  left: 0.8rem;
  color: var(--muted);
  transform: translateY(-50%);
}

.amount-edit input {
  padding-left: 1.7rem;
}

.remove-deduction {
  min-width: 2.9rem;
  min-height: 2.9rem;
  border-radius: 0.6rem;
  color: #8b3a32;
  background: #f7e9e6;
  font-size: 1.1rem;
}

.custom-empty {
  margin: 1rem 0 0 !important;
  padding: 0.85rem;
  border: 1px dashed var(--line);
  border-radius: 0.65rem;
  text-align: center;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.check-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4.6rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  cursor: pointer;
  background: white;
}

.check-card:hover {
  border-color: #9aaba2;
}

.check-card input {
  position: absolute;
  opacity: 0;
}

.checkmark {
  display: grid;
  flex: 0 0 1.35rem;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  border: 1.5px solid #9aaba2;
  border-radius: 0.3rem;
}

.check-card input:checked + .checkmark {
  border-color: var(--green);
  background: var(--green);
}

.check-card input:checked + .checkmark::after {
  content: "✓";
  color: white;
  font-size: 0.9rem;
  font-weight: 800;
}

.check-card input:focus-visible + .checkmark {
  outline: 3px solid rgba(200, 137, 37, 0.45);
  outline-offset: 2px;
}

.check-card > span:last-child {
  display: grid;
  gap: 0.1rem;
}

.check-card strong {
  font-size: 0.9rem;
}

.results {
  display: grid;
  grid-template-columns: minmax(10rem, 0.4fr) 1fr;
  gap: 2rem;
  margin-top: 1.25rem;
  padding: clamp(1.5rem, 4vw, 2.4rem);
}

.results-period {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.pay-summary {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: white;
}

.calculation-lines {
  padding: 0.25rem 1.25rem;
}

.calculation-row,
.gross-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.deduction-lines {
  border-top: 1px solid var(--line);
}

.total-deductions-row {
  color: var(--green-dark);
}

.optional-results {
  border-top: 1px solid var(--line);
  background: #fbfaf5;
}

.results-subheading,
.all-deductions-total,
.optional-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.results-subheading {
  padding: 0.9rem 0;
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.optional-result-row {
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
}

.optional-result-row output,
.results-subheading output,
.all-deductions-total output {
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.result-empty {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.all-deductions-total {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--green-dark);
  background: #f7f8f4;
  font-weight: 800;
}

.net-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.3rem 1.25rem;
  color: var(--ink);
  background: var(--mint);
}

.net-total > span {
  display: grid;
  gap: 0.2rem;
}

.net-total small {
  color: var(--muted);
  font-size: 0.82rem;
}

.net-total output {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  font-variant-numeric: tabular-nums;
}

.calculation-row {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.calculation-row:last-child {
  border-bottom: 0;
}

.calculation-row > span,
.gross-total > span {
  display: grid;
  gap: 0.2rem;
}

.calculation-row strong {
  font-size: 0.9rem;
}

.calculation-row output {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.gross-total {
  padding: 1.3rem 1.25rem;
  color: white;
  background: var(--green);
}

.gross-total output {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  font-variant-numeric: tabular-nums;
}

.gross-total small {
  color: rgba(255, 255, 255, 0.72);
}

.deduction-note {
  margin: 0;
  padding: 0.85rem 1.25rem;
  color: var(--muted);
  background: #f7f8f4;
  font-size: 0.76rem;
  line-height: 1.45;
}

.deduction-note a {
  color: var(--green);
  font-weight: 700;
}

footer {
  padding: 1.5rem 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.76rem;
}

footer p {
  margin-bottom: 0;
}

footer a {
  color: var(--green);
  font-weight: 700;
}

@media (max-width: 700px) {
  .page-shell {
    width: min(100% - 1.25rem, 72rem);
    padding-top: 2.5rem;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 1.25rem;
  }

  .segmented-control label {
    flex: 1;
    text-align: center;
  }

  .field-grid,
  .checkbox-grid,
  .td1-grid,
  .results {
    grid-template-columns: 1fr;
  }

  .field.full-width .input-wrap {
    max-width: none;
  }

  .results {
    gap: 1.25rem;
  }

  .calculation-row {
    align-items: end;
  }

  .other-deductions-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .add-deduction {
    align-self: start;
  }

  .custom-deduction-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .custom-deduction-row > input:first-child {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Kept outside calculator/results and away from all form controls. */
.advertisement { max-width: 45.5rem; margin: 2.5rem auto 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.advertisement[hidden] { display: none; }
.advertisement-label { margin: 0 0 .75rem; color: var(--muted); text-align: center; font-size: .75rem; }
.privacy-page { max-width: 48rem; line-height: 1.65; }
.privacy-page h1 { font-size: clamp(2rem, 5vw, 3rem); }
.privacy-page h2 { margin-top: 2rem; font-size: 1.25rem; }
.privacy-page a { color: var(--green); }

.site-links { display:flex; flex-wrap:wrap; justify-content:center; gap:.75rem 1.5rem; }
.estimate-guide { max-width:48rem; margin:2.5rem auto 0; line-height:1.65; }
.estimate-guide h2 { font-size:1.25rem; }
#quebec-note[hidden] { display:none; }

.contact-form { display:grid; gap:.65rem; margin-top:2rem; }
.contact-form label { font-weight:650; margin-top:.5rem; }
.contact-form input:not([type="hidden"]), .contact-form textarea { width:100%; min-width:0; padding:.85rem 1rem; border:1px solid var(--line); border-radius:.6rem; background:white; color:var(--ink); font:inherit; }
.contact-form textarea { resize:vertical; }
.contact-form input:focus-visible,.contact-form textarea:focus-visible,.contact-form button:focus-visible { outline:3px solid var(--focus); outline-offset:3px; }
.contact-form button { justify-self:start; padding:.85rem 1.4rem; background:var(--green); color:white; border:0; border-radius:.6rem; cursor:pointer; }
.contact-form button:hover { background:var(--green-dark); }
.contact-note { font-size:.875rem; margin:.5rem 0; }
