.withholding {
  --calc-paper: #f7f5ef;
  --calc-control: #fffdf9;
  --calc-pale: #dce9e2;
  padding-block: clamp(48px, 6vw, 86px);
  background: var(--calc-paper);
}

.withholding-head {
  position: relative;
  margin-bottom: clamp(28px, 4vw, 54px);
  padding-top: 12px;
}

.withholding-head::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 62%;
  height: 32px;
  border-top: 1px solid var(--forest);
  border-right: 1px solid var(--forest);
  pointer-events: none;
}

.withholding-head h2 {
  font-size: clamp(32px, 5.3vw, 75px);
  font-weight: 700;
  line-height: 1.07;
}

.withholding-head h2 span {
  color: var(--forest);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .14em;
}

.withholding-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  margin-top: 20px;
}

.withholding-intro p {
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 20px);
}

.withholding-skip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--forest);
  font-size: 15px;
  font-weight: 600;
}

.withholding-skip:hover { color: var(--ink); }

.withholding-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr);
  border: 1px solid #dadfd6;
  border-radius: 20px;
  background: var(--calc-control);
}

.withholding-controls,
.withholding-summary,
.withholding-next {
  min-width: 0;
  padding: clamp(20px, 3vw, 46px);
}

.withholding-types {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}

.withholding-types legend,
.withholding-label label {
  font-size: clamp(16px, 1.4vw, 20px);
  font-weight: 650;
  line-height: 1.25;
}

.withholding-types legend { padding: 0; margin-bottom: 10px; }

.withholding-types > div,
.withholding-presets {
  display: grid;
  gap: 8px;
}

.withholding-types > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.withholding-types label { position: relative; cursor: pointer; }

.withholding-types input,
.withholding-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.withholding-types label span,
.withholding-presets button {
  display: grid;
  place-items: center;
  border: 1px solid #9aaea4;
  border-radius: 8px;
  background: var(--calc-control);
  color: var(--ink);
  text-align: center;
}

.withholding-types label span {
  min-height: 48px;
  padding: 6px;
  font-weight: 600;
}

.withholding-types input:checked + span,
.withholding-presets button[aria-pressed="true"] {
  border-color: var(--forest);
  background: var(--calc-pale);
  box-shadow: inset 0 0 0 1px var(--forest);
  color: var(--dark);
  font-weight: 650;
}

.withholding-field { margin-top: clamp(20px, 2.5vw, 36px); }

.withholding-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.withholding-label span {
  flex: none;
  color: var(--forest);
  font-size: clamp(20px, 2.1vw, 28px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.withholding input[type="range"] {
  display: block;
  appearance: none;
  width: 100%;
  height: 44px;
  margin: 0 0 5px;
  background: transparent;
  cursor: pointer;
}

.withholding input[type="range"]:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
  border-radius: 5px;
}

.withholding input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(to right, var(--forest) var(--range-progress, 0%), #dce4de var(--range-progress, 0%));
}

.withholding input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 36px;
  height: 36px;
  margin-top: -13px;
  border: 3px solid var(--forest);
  border-radius: 50%;
  background: var(--calc-control);
}

.withholding input[type="range"]::-moz-range-track { height: 10px; border-radius: 5px; background: #dce4de; }
.withholding input[type="range"]::-moz-range-progress { height: 10px; border-radius: 5px; background: var(--forest); }
.withholding input[type="range"]::-moz-range-thumb { width: 30px; height: 30px; border: 3px solid var(--forest); border-radius: 50%; background: var(--calc-control); }

.withholding-presets {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.withholding-presets button {
  min-height: 44px;
  padding: 4px 2px;
  font-size: clamp(13px, 1.15vw, 16px);
  white-space: nowrap;
}

.withholding-note {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.withholding-result {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 19px;
  overflow: hidden;
  background: #dce7dd;
}

.withholding-summary {
  background: var(--dark);
  color: var(--calc-control);
}

.withholding-summary h3 {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: clamp(17px, 1.7vw, 23px);
  font-weight: 600;
}

.withholding-summary h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #9aafa2;
}

.withholding-figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.4vw, 20px);
  margin-top: clamp(19px, 2.4vw, 30px);
}

.withholding-figures p { font-size: clamp(14px, 1.35vw, 17px); }

.withholding-figures p + p {
  padding-inline-start: clamp(12px, 1.5vw, 22px);
  border-inline-start: 1px solid #71877c;
}

.withholding-figures strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.12;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}

#withholding-monthly { white-space: nowrap; }

.withholding-figures small {
  display: inline-block;
  font-size: clamp(14px, 1.25vw, 17px);
  font-weight: 500;
  letter-spacing: 0;
}

.withholding-next { flex: 1; }

.withholding-next h4 {
  margin: 0;
  font-size: clamp(24px, 2.8vw, 39px);
  line-height: 1.08;
  letter-spacing: -.045em;
}

.withholding-action {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px clamp(16px, 3vw, 34px);
  margin-top: clamp(16px, 2.6vw, 32px);
  font-size: clamp(14px, 1.5vw, 18px);
}

.withholding .withholding-cta {
  min-height: clamp(48px, 4.6vw, 64px);
  min-width: clamp(166px, 18vw, 246px);
  padding: 9px 18px;
  border-color: transparent;
  border-radius: 10px;
  background: var(--dark);
  color: var(--calc-control);
  font-size: clamp(16px, 1.65vw, 22px);
}

.withholding .withholding-cta:hover { background: var(--forest); }

.withholding-route {
  display: grid;
  gap: 4px;
  margin-top: clamp(22px, 3.2vw, 40px);
  font-size: clamp(14px, 1.35vw, 17px);
}

.withholding-route strong { font-size: clamp(18px, 2vw, 27px); line-height: 1.15; }
.withholding-next .withholding-note { border-color: #9caf9f; color: #30443a; }

@media (max-width: 1100px) {
  .withholding-figures { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .withholding-figures p + p {
    padding: 12px 0 0;
    border: 0;
    border-top: 1px solid #71877c;
  }
}

@media (max-width: 700px) {
  .withholding-head::before { left: 74%; height: 18px; }
  .withholding-layout { grid-template-columns: minmax(0, 1fr); }
  .withholding-controls,
  .withholding-summary,
  .withholding-next { padding: 20px 16px; }
  .withholding-action { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .withholding-head h2 { font-size: clamp(28px, 8vw, 32px); }
}
