* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #e8f0fa;
  color: #122c47;
  font:
    15px -apple-system,
    BlinkMacSystemFont,
    Arial,
    sans-serif;
}
#app {
  max-width: 500px;
  margin: auto;
  min-height: 100vh;
  background: #f5f9fd;
}
main {
  padding: 15px 15px 90px;
}
.panel {
  background: white;
  border: 1px solid #b8cde2;
  border-radius: 15px;
  padding: 15px;
  margin-bottom: 12px;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: white;
  border: 1px solid #6687aa;
  border-radius: 9px;
  padding: 11px;
  font-weight: 650;
}
button.primary,
.on {
  background: #194e83;
  color: white;
}
button.primary {
  width: 100%;
  margin: 8px 0;
}
.tile {
  text-align: left;
  min-height: 95px;
}
.tile strong {
  display: block;
  margin: 7px 0;
}
small {
  font-size: 12px;
  line-height: 1.5;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin: 12px 0;
}
input,
select {
  display: block;
  width: 100%;
  padding: 10px;
  background: white;
  border: 1px solid #6687aa;
  border-radius: 8px;
  margin-top: 5px;
  font-size: 16px;
}
h2 {
  font-size: 22px;
}
h3 {
  font-size: 16px;
}
.amount {
  font-size: 30px;
  font-weight: 800;
  color: #08644f;
  margin: 6px 0;
}
.out,
.note {
  background: #eaf2fc;
  padding: 12px;
  border-radius: 10px;
}
.note {
  font-size: 12px;
  line-height: 1.5;
  margin: 10px 0;
}
.seg {
  display: flex;
  gap: 4px;
  margin: 12px 0;
}
.seg button {
  flex: 1;
  padding: 8px 4px;
  font-size: 12px;
}
.legend {
  display: grid;
  grid-template-columns: 11px 1fr auto 45px;
  gap: 7px;
  align-items: center;
  font-size: 12px;
  border-bottom: 1px solid #b8cde2;
  padding: 9px 0;
}
.dot {
  height: 10px;
  border-radius: 2px;
}
.tag {
  background: #ffedb9;
  color: #644400;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 800;
}
nav {
  position: fixed;
  bottom: var(--app-footer-height);
  left: 50%;
  transform: translateX(-50%);
  width: min(500px, 100%);
  display: flex;
  background: white;
  border-top: 1px solid #9bb7d1;
  padding: 8px 4px;
}
nav button {
  flex: 1;
  border: 0;
  font-size: 12px;
}
details {
  padding: 8px 0;
}
summary {
  cursor: pointer;
  font-weight: 650;
}
a {
  color: #194e83;
}
.build-note {
  margin: 0;
  text-align: center;
  font-size: 11px;
  padding: 14px;
}
[hidden] {
  display: none !important;
}
:root {
  color-scheme: light;
}
body {
  font-size: 16px;
}
#app,
nav {
  max-width: 720px;
}
nav {
  width: min(720px, 100%);
  z-index: 2;
}
nav button {
  min-width: 0;
  padding: 10px 2px;
}
small {
  font-size: 13px;
}
label {
  font-size: 14px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #bd7300;
  outline-offset: 2px;
}
.legend {
  width: 100%;
  padding: 10px 8px;
  text-align: left;
  font-size: 14px;
  border-radius: 5px;
  grid-template-columns: 11px minmax(0, 1fr) auto 45px;
}
.legend[aria-pressed="true"] {
  border: 2px solid #285da2;
  background: #eaf2fc;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.check input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
}
.numeric-value {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.row > strong.numeric-value { flex: 0 0 auto; }
.row > strong { text-align: end; }
html[data-theme="dark"] {
  color-scheme: dark;
}
[data-theme="dark"] body,
[data-theme="dark"] #app {
  background: #101e30;
  color: #edf5ff;
}
[data-theme="dark"] .panel,
[data-theme="dark"] nav,
[data-theme="dark"] button {
  background: #192c43;
  color: #edf5ff;
}
[data-theme="dark"] input,
[data-theme="dark"] select {
  background: white;
  color: #122c47;
  color-scheme: light;
}
[data-theme="dark"] .out,
[data-theme="dark"] .note,
[data-theme="dark"] button.on,
[data-theme="dark"] .legend[aria-pressed="true"] {
  background: #294565;
  color: #fff;
}
[data-theme="dark"] .amount {
  color: #83e5bc;
}
[data-theme="dark"] a {
  color: #a8d4ff;
}
[data-theme="dark"] .donut-center {
  background: #192c43 !important;
}
@media (max-width: 380px) {
  header .row {
    flex-wrap: wrap;
  }
  .legend {
    font-size: 12px;
  }
}
@media print {
  nav,
  button {
    display: none !important;
  }
  main {
    padding: 0;
  }
  #app {
    max-width: none;
  }
}

.pie-area { position: relative; display: flow-root; padding-block-start: 50px; cursor: pointer; }
.pie-area > .pie-breakdown-shortcut {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-end: 0;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-block-size: 44px;
  padding: 2px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 0.75rem;
  line-height: 1.15;
  white-space: nowrap;
}
.pie-breakdown-shortcut > :last-child { color: var(--muted); }
.pie-breakdown-mark {
  position: relative;
  inline-size: 24px;
  block-size: 24px;
  border: 1px solid var(--rule);
  border-radius: 7px;
}
.pie-breakdown-shortcut:hover .pie-breakdown-mark { border-color: var(--muted); }
.pie-breakdown-mark::before,
.pie-breakdown-mark::after {
  content: "";
  position: absolute;
  inset: 4px 4px 3px 3px;
  border-radius: 50%;
}
.pie-breakdown-mark::before {
  background: conic-gradient(transparent 0 90deg, currentColor 90deg 360deg);
}
.pie-breakdown-mark::after {
  background: conic-gradient(#19865f 0 90deg, transparent 90deg 360deg);
  transform: translate(2px, -2px);
}
[data-theme="dark"] .pie-breakdown-mark::after {
  background: conic-gradient(#8bddbb 0 90deg, transparent 90deg 360deg);
}
.pie-figure {
  position: relative;
  width: min(100%, 22rem);
  aspect-ratio: var(--pie-aspect);
  margin: 8px auto;
}
.donut {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--pie-diameter);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  margin: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.donut-center {
  width: var(--pie-hole);
  height: var(--pie-hole);
  border-radius: 50%;
  background: white;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-content: center;
  text-align: center;
}

/* Worksheet layout */
:root {
  --ink: #132c44;
  --rule: #d8e2eb;
  --paper: #fff;
  --background: #f1f5f8;
  --muted: #435a70;
  --selection: #e7eff9;
  --selection-ink: #173f69;
  --nav-accent: #236499;
  --icon-accent: #08644f;
  --app-header-height: 0px;
  --app-footer-height: calc(22px + env(safe-area-inset-bottom, 0px));
  --app-tabs-height: 0px;
  --app-bottom-inset: var(--app-footer-height);
  scroll-padding-block: var(--app-header-height) calc(var(--app-bottom-inset) + 8px);
}
body {
  background: var(--background);
  color: var(--ink);
  font-family: system-ui, sans-serif;
  line-height: 1.45;
}
#app {
  max-width: 1180px;
  background: transparent;
}
header {
  position: sticky;
  inset-block-start: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px clamp(14px, 4vw, 44px);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
header h1 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.625rem);
  font-weight: 720;
  line-height: 1.15;
  letter-spacing: -0.027em;
}
.brand span { color: var(--muted); font-size: 0.8125rem; }
.tax-year-choice {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 3px 0 0;
  color: var(--muted);
}
.tax-year-choice select {
  width: auto;
  min-height: 25px;
  margin: 0;
  padding: 2px 5px;
  font-size: 0.8125rem;
}
.header-actions { display: flex; align-items: center; gap: 6px; }
#theme,
.header-actions .payroll-tools-menu > summary {
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  background: var(--paper);
  color: var(--ink);
}
#theme { padding: 0; }
.theme-mark { position: relative; display: block; inline-size: 18px; block-size: 18px; }
.theme-mark::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  box-shadow: inset 5px -3px currentColor;
  transform: rotate(-15deg);
}
[data-theme="dark"] .theme-mark {
  background: linear-gradient(currentColor, currentColor) center top / 1.5px 3px no-repeat,
    linear-gradient(currentColor, currentColor) center bottom / 1.5px 3px no-repeat,
    linear-gradient(currentColor, currentColor) left center / 3px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) right center / 3px 1.5px no-repeat;
}
[data-theme="dark"] .theme-mark::before {
  inset: 4.5px;
  border: 1.5px solid currentColor;
  box-shadow: none;
  transform: none;
}
[data-theme="dark"] .theme-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
  transform: rotate(45deg);
}
main { padding: 20px clamp(14px, 4vw, 44px) calc(24px + var(--app-bottom-inset)); }
main > h2 { margin: 0 0 16px; }
.panel, .tool-directory {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 2px 6px #132c440d;
  padding: clamp(14px, 3vw, 24px);
}
button, input, select, .out, .note {
  border-radius: 8px;
}
button:hover { border-color: #315f87; }
.amount {
  font-size: clamp(1.65rem, 5vw, 2.8rem);
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -0.03em;
}
.amount, .legend, .row strong { font-variant-numeric: tabular-nums; }
.result-title { font-size: 15px; margin: 0; }
.seg { gap: 0; }
.seg button + button { margin-left: -1px; }
.calculator-deductions-link {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  background: var(--paper);
  color: var(--ink);
}
.calculator-deductions-link .tag { margin-inline-start: 4px; }
.legend {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  font-weight: 400;
}
.legend strong { font-weight: 650; }
.state-rate-detail {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 0.8125rem;
}
.state-rate-detail strong { text-align: right; font-variant-numeric: tabular-nums; }
#pdf-status:empty { margin: 0; padding: 0; border: 0; }
.tool-directory h2 {
  font-size: 17px;
  margin: 0 0 9px;
}
.tool-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 43px;
  gap: 12px;
  padding: 8px 1px;
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 550;
}
.tag { border-radius: 3px; font-size: 11px; }
nav .tag { margin-inline-start: 3px; padding: 2px 4px; }
.nav-mark, .payroll-tool-mark {
  position: relative;
  width: 16px;
  height: 16px;
}
.nav-mark { display: none; }
.nav-mark::before, .nav-mark::after, .payroll-tool-mark::before, .payroll-tool-mark::after {
  position: absolute;
  content: "";
}
.nav-mark-home::before {
  inset: 1px 1px 2px;
  background:
    linear-gradient(currentColor, currentColor) left bottom / 3px 6px no-repeat,
    linear-gradient(currentColor, currentColor) center bottom / 3px 9px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 3px 13px no-repeat;
}
.nav-mark-calc::before {
  inset: 0 2px;
  border: 1px solid currentColor;
  border-radius: 3px;
  background: linear-gradient(currentColor, currentColor) center 2px / 6px 2px no-repeat;
}
.nav-mark-calc::after {
  top: 8px;
  left: 5px;
  width: 2px;
  height: 2px;
  background: currentColor;
  box-shadow: 4px 0, 0 4px, 4px 4px;
}
.nav-mark-deduct::before {
  top: 2px;
  left: 1px;
  width: 14px;
  height: 1px;
  background: currentColor;
  box-shadow: 0 5px, 0 10px;
}
.nav-mark-deduct::after {
  top: 1px;
  left: 4px;
  width: 3px;
  height: 3px;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 5px 5px, -1px 10px;
}
nav button.on {
  background: var(--selection);
  color: var(--selection-ink);
  border-radius: 7px;
  box-shadow: inset 0 -2px var(--nav-accent);
}
@media (max-width: 759px) {
  :root { --app-bottom-inset: calc(var(--app-footer-height) + var(--app-tabs-height)); }
  nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(min(46%, 8.5rem), 1fr);
    gap: 4px;
    border-color: var(--rule);
    padding: 4px 6px 2px;
  }
  nav button {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 16px auto;
    align-content: center;
    justify-items: center;
    gap: 2px;
    min-height: 44px;
    padding: 0 2px;
    background: transparent;
    color: var(--muted);
  }
  .nav-label {
    grid-area: 2 / 1;
    max-inline-size: 100%;
    line-height: 1.15;
    text-align: center;
  }
  nav .tag {
    grid-area: 1 / 1;
    align-self: center;
    margin: 0;
    line-height: 1;
    transform: translateX(calc(50% + 12px));
  }
  .nav-mark {
    grid-area: 1 / 1;
    display: block;
  }
  nav button.on .nav-mark { color: var(--icon-accent); }
  [data-theme="dark"] nav button:not(.on) {
    background: transparent;
    color: var(--muted);
  }
}
.app-footer {
  position: fixed;
  inset: auto 0 0;
  z-index: 2;
  width: min(100%, 1180px);
  margin-inline: auto;
  padding: 3px 8px calc(4px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--rule);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.25;
  text-align: center;
}
@media (max-width: 759px) {
  .app-footer { width: min(100%, 720px); }
  #app:not([data-setup]) .app-footer { border-top: 0; }
}
[data-theme="dark"] {
  --ink: #edf5ff;
  --rule: #536b82;
  --paper: #192c43;
  --muted: #c0d2e4;
  --icon-accent: #83e5bc;
}
[data-theme="dark"] header { background: #122c47; }
[data-theme="dark"] #theme,
[data-theme="dark"] .header-actions .payroll-tools-menu > summary {
  background: transparent;
  color: var(--ink);
}
[data-theme="dark"] nav button.on { color: #fff; box-shadow: none; }
[data-theme="dark"] .tool-link, [data-theme="dark"] .legend { background: transparent; }
@media (min-width: 760px) {
  #app { display: grid; grid-template-areas: "header" "nav" "work"; grid-template-rows: auto auto 1fr; }
  header { grid-area: header; }
  main { grid-area: work; }
  nav {
    grid-area: nav;
    position: static;
    transform: none;
    width: 100%;
    max-width: none;
    padding: 0 44px;
    justify-content: flex-start;
    border: 0;
    border-bottom: 1px solid var(--rule);
  }
  nav button {
    flex: 0 1 auto;
    padding: 11px 20px;
    font-size: 14px;
    border-radius: 0;
  }
  .workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 290px);
    gap: 22px;
    align-items: start;
  }
  .workspace > * { min-width: 0; }
}
@media print {
  #app { display: block; }
  #app > main { padding-bottom: 0; }
  header { position: static; }
  nav, .header-actions { display: none !important; }
  .app-footer { position: static; width: auto; padding: 4px 0; border: 0; }
}

.federal-breakdown {
  border-top: 1px solid var(--rule);
  margin-top: 14px;
  padding-top: 4px;
}
.federal-breakdown .row:last-child {
  border-top: 1px solid var(--rule);
  padding-top: 8px;
}
.summary-period-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 8px;
}
.summary-period-heading small { color: var(--muted); font-size: 0.8125rem; font-weight: 650; }

.salary-inputs h2 {
  margin: 0 0 12px;
}
@media (min-width: 760px) {
  .calculator-workspace {
    max-width: 840px;
    margin-inline: auto;
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, 1fr);
  }
  .calculator-workspace .salary-inputs { margin-bottom: 0; }
}

.salary-inputs { --paired-control-size: 40px; }
.salary-inputs > .other-income {
  padding: 0;
  margin-top: 5px;
  border-top: 1px solid var(--rule);
}
.other-income > summary {
  min-height: 34px;
  padding-block: 7px;
  font-size: 0.875rem;
}
.other-income > p { margin: 5px 0; font-size: 0.8125rem; color: var(--muted); }
.salary-inputs h2 { font-size: 18px; margin-bottom: 6px; }
.salary-inputs label { margin: 6px 0 0; min-width: 0; }
.calculator-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.calculator-heading label { display: flex; align-items: center; gap: 6px; margin: 0; }
.calculator-heading select { width: auto; margin: 0; }
.salary-inputs input, .salary-inputs select {
  min-height: 40px;
  margin-top: 2px;
  padding: 6px 8px;
}
.salary-pair, .bonus-pair, .deduction-fields, .hourly-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.salary-pair > .full-width-field { grid-column: 1 / -1; }
:is(.salary-pair, .bonus-pair, .deduction-fields, .hourly-settings) > label {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-inline-size: 0;
}
:is(.salary-pair, .bonus-pair, .deduction-fields, .hourly-settings) :is(label > select, label > input[type="date"], .numeric-control > input[type="text"]) {
  block-size: var(--paired-control-size, 44px);
  min-inline-size: 0;
  padding-block: 6px;
}
.salary-pair.pay-settings {
  display: flex;
  flex-wrap: wrap;
  row-gap: 0;
  --pay-select-start: 6px;
  --pay-select-end: 16px;
  --pay-select-font-size: 1rem;
}
.pay-settings > label {
  flex: 1 1 0;
  min-inline-size: min-content;
  max-inline-size: 100%;
}
.pay-settings > label::after {
  /* Use the selected option's text to reserve space before flex wraps the controls. */
  content: attr(data-selected-label);
  white-space: nowrap;
  block-size: 0;
  overflow: hidden;
  visibility: hidden;
  padding-inline: calc(var(--pay-select-start) + 2px) calc(var(--pay-select-end) + 2px);
  font-size: var(--pay-select-font-size);
}
.salary-inputs .pay-settings select {
  appearance: none;
  padding-inline: var(--pay-select-start) var(--pay-select-end);
  font-size: var(--pay-select-font-size);
  background-image: linear-gradient(45deg, transparent 50%, #132c44 50%),
    linear-gradient(135deg, #132c44 50%, transparent 50%);
  background-position: right 7px center, right 4px center;
  background-size: 3px 3px;
  background-repeat: no-repeat;
}
@media (max-width: 759px) {
  header { padding-block: 8px; }
  main:has(.salary-inputs) { padding-top: 10px; }
  .salary-inputs { padding-block: 10px; margin-bottom: 8px; }
}

.take-home-periods button {
  min-width: 0;
  display: grid;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 760px) {
  .deduction-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

.donut-opener { border: 0; padding: 0; font-weight: inherit; }
.pie-annotations {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.pie-highlight {
  fill: var(--slice-color);
  fill: color-mix(in srgb, var(--slice-color), white 12%);
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.pie-annotations .donut-label-background { fill: #ffedb9; }
.pie-annotations .chart-percentage { fill: #142b42; }
.pie-annotations polyline {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.6;
}
.donut-center { padding: 8px 3px; }
.donut-center small { font-size: 11px; line-height: 1.2; }
.donut-center strong { font-size: 0.875rem; line-height: 1.3; }
.donut-center span { font-size: 12px; }
.donut-center .donut-open-label {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.2;
}
@media (max-width: 360px) {
  .donut-center strong { font-size: 0.75rem; }
}

.distribution-card { max-width: 560px; margin-inline: auto; }
.distribution-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 8px;
}
.distribution-toolbar h2 { margin: 0; font-size: 1.25rem; }
.distribution-toolbar button { min-height: 44px; padding: 5px 8px; font-size: 0.8125rem; }
.distribution-views button { min-height: 44px; font-size: 0.875rem; }
.distribution-total .row { margin: 0 0 3px; }
.distribution-total small, .distribution-share-label { color: var(--muted); }
.distribution-share-label { margin: 6px 0 4px; font-size: 0.8125rem; }

.earner {
  margin: 10px 0 0;
  padding: 5px 8px 8px;
  border: 1px solid var(--rule);
  min-width: 0;
}
.earner legend { font-weight: 650; padding-inline: 4px; }
.joint-pay-labels { display: none; }

.retirement-preview {
  border-top: 1px solid var(--rule);
  margin-top: 8px;
  font-size: 13px;
}
.retirement-preview .row { margin: 5px 0; }

.deduction-jumps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}
.deduction-jumps .primary { min-height: 44px; margin: 0; padding: 6px; font-size: 13px; }
.payroll-deduction-breakdown > h3 { margin-bottom: 4px; }
.payroll-deduction-breakdown > p,
.payroll-deduction-empty { margin: 0 0 8px; font-size: 13px; }
.joint-payroll-grid { display: grid; gap: 8px; align-items: start; }
.joint-payroll-detail { border: 1px solid var(--rule); border-radius: 8px; padding: 8px; }
.joint-payroll-detail h4 { margin: 0 0 6px; }
.joint-payroll-detail .row { margin: 5px 0; }
.joint-payroll-detail .row:last-child { margin-bottom: 0; font-weight: 700; }
.payroll-deduction-total {
  margin-top: 8px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 8px;
  font-weight: 700;
}
.payroll-deduction-total .row:last-child { border: 0; margin: 0; padding: 0; }
@media (min-width: 580px) {
  .joint-payroll-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.deduction-categories {
  display: grid;
  gap: 10px;
  padding: 8px;
}
.deduction-category-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.deduction-category-note { margin: 0; color: var(--muted); font-size: 0.8125rem; }
.deduction-method > label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0;
}
.deduction-method select {
  margin: 0;
  min-height: 38px;
  padding: 6px;
}
.deduction-method-advice { margin-top: 8px; font-size: 0.875rem; }
.deduction-method-advice .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  margin: 0 0 4px;
  column-gap: 10px;
}
.deduction-method-advice p { margin: 8px 0 0; }
.deduction-method-advice .deduction-method-scope { color: var(--muted); }
.deduction-method-advice button { margin-top: 8px; min-height: 44px; }
@media (max-width: 430px) {
  .deduction-method > label { grid-template-columns: minmax(0, 1fr); gap: 3px; }
}
.deduction-categories .tool-link {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 7px 9px;
}
@media (hover: hover) {
  .deduction-categories .tool-link:hover {
    background-color: color-mix(in srgb, currentColor 5%, transparent);
  }
}
.deduction-categories .deduction-menu-link {
  min-height: 44px;
  border-radius: 8px;
}
.deduction-menu-link > span {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: start;
}
.deduction-categories .deduction-menu-link .deduction-category-name {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 750;
  color: var(--icon-accent);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--rule);
}
.deduction-menu-link .deduction-category-name::after {
  content: "";
  flex: none;
  inline-size: 9px;
  block-size: 9px;
  margin-inline-end: 3px;
  border: solid var(--icon-accent);
  border-width: 0 3px 3px 0;
  transform: rotate(-45deg);
}
.deduction-categories .deduction-category-amount { font-size: 0.875rem; font-weight: 650; }
.deduction-categories .deduction-category-name { font-weight: 650; }
.deduction-category-hint { display: block; font-size: 0.8125rem; font-weight: 500; }
.deduction-menu-groups {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 3px 1rem;
  margin-top: 3px;
  line-height: 1.3;
}
.deduction-menu-groups strong { font-weight: 650; color: var(--muted); }
.deduction-categories .tool-link:has(.deduction-category-amount) {
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  gap: 4px;
  min-height: 55px;
  border-radius: 8px;
  text-align: center;
}
#deduction-layer-title { margin-top: 0; }

.deductions-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; }
.deductions-heading h2 { margin: 0; font-size: 21px; }
.deductions-heading .primary { width: auto; min-height: 44px; margin: 0; padding: 6px 8px; font-size: 13px; }
.deductions-heading + .panel { margin-top: 8px; }
.deduction-back { min-height: 44px; padding: 6px 8px; font-size: 13px; }
.itemized-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.itemized-heading h2 { margin: 0; font-size: 1.125rem; line-height: 1.25; }
.itemized-actions { display: flex; gap: 4px; }
.itemized-actions button { width: auto; min-width: 44px; min-height: 44px; margin: 0; padding: 4px 8px; font-size: 0.8125rem; }
.deduction-unit { margin: 0; color: var(--muted); font-size: 13px; }
.deduction-layer { --paired-control-size: 38px; padding: 10px; margin-bottom: 6px; }
.deduction-layer > p { margin: 4px 0 6px; font-size: 13px; }
.deduction-layer h3 { margin-bottom: 5px; }
.deduction-fields { row-gap: 5px; }
.hsa-contributions { align-items: end; }
.deduction-layer label { margin: 4px 0; min-width: 0; }
.deduction-layer input[type="text"], .deduction-layer select { padding: 6px 8px; margin-top: 3px; min-height: 38px; }
.deduction-layer .earner { margin-top: 5px; }
.retirement-contribution { min-width: 0; }
.retirement-contribution > .numeric-field { margin-block: 4px 0; }
.entry-unit-buttons { margin: 0; }
.entry-unit-buttons > button { min-height: 44px; padding: 4px 2px; white-space: nowrap; }
.retirement-contribution > .entry-unit-buttons { margin-block-start: 4px; }
.deduction-layer .retirement-preview { margin-top: 4px; }
.deduction-layer .retirement-preview .row { margin: 3px 0; }
.deduction-help { padding: 6px 0 0; font-size: 13px; }
.deduction-help p { margin: 4px 0 0; }
.deduction-help ul { margin: 6px 0 0; padding-inline-start: 20px; }
.deduction-help li + li { margin-top: 4px; }
.mortgage-loans > p { margin: 5px 0; font-size: 13px; }
.mortgage-date-help { margin: 4px 0 0; font-size: 0.8125rem; color: var(--muted); }
.grandfathered-loan-help { display: none; }
#mortgage-date-option:has(input:checked) .grandfathered-loan-help { display: block; }
#calculated-mortgage-interest { padding-inline-end: 8px; }
.property-companion-links {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.property-companion-links > .tool-link {
  min-height: 44px;
  padding: 7px 9px;
  border: 1px solid var(--rule);
  border-radius: 8px;
}
#mortgage-estimate, #medical-estimate { margin: 6px 0; }
#mortgage-estimate .row, #medical-estimate .row { margin: 0; }
#medical-estimate .row + .row { margin-top: 4px; }
.optional-deduction { padding-block: 2px; }
.optional-deduction > p { margin: 5px 0; font-size: 0.8125rem; }
.deduction-summary-link {
  width: 100%;
  min-height: 44px;
  margin-block: 0;
  padding: 6px 8px;
  border-color: var(--rule);
  background: var(--paper);
  text-align: start;
  font-weight: 500;
}
@media (max-width: 759px) {
  main:has(.deductions-page) { padding-top: 8px; }
  .deductions-page .deduction-categories {
    margin-bottom: 8px;
  }
  .deduction-category-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deduction-category-tiles > .tool-link:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    min-height: 44px;
    gap: 4px 8px;
    text-align: left;
  }
  .deduction-category-tiles > .tool-link:last-child:nth-child(odd) > span:first-child {
    flex: 1 1 0;
    min-width: 0;
  }
  .deductions-page .deduction-categories button {
    justify-content: center;
    min-height: 44px;
    padding: 7px 10px;
    font-size: 14px;
    line-height: 1.25;
    text-align: center;
  }
  .deduction-layer label { font-size: 13px; }
}
@media (min-width: 361px) and (max-width: 759px) {
  .deduction-category-tiles > .tool-link:has(> #deduction-category-charity-amount) {
    display: grid;
    grid-template-columns: subgrid;
    grid-template-rows: auto;
    column-gap: normal;
    padding-inline: 0;
    text-align: center;
  }
}
@media (max-width: 360px) {
  .deductions-page .deduction-category-tiles { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .deductions-page .deduction-category-tiles > .tool-link:has(.deduction-category-amount) {
    display: flex;
    justify-content: space-between;
    text-align: start;
    gap: 4px 8px;
    min-height: 44px;
  }
}
@media (min-width: 760px) {
  .deduction-category-tiles:has(> .deduction-breakdown-tile) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .deduction-category-tiles:has(> .deduction-breakdown-tile) > .tool-link {
    justify-content: center;
  }
}
.deductions-page .deduction-categories .deduction-category-tiles > .deduction-breakdown-tile {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  grid-template-rows: auto auto;
  column-gap: normal;
  row-gap: 8px;
  padding: 14px 0;
  text-align: start;
}
.deduction-breakdown-tile > .deduction-category-name {
  grid-area: 1 / 1;
  justify-self: start;
  margin-inline-start: 10px;
  font-size: 1rem;
}
.deduction-breakdown-tile > .deduction-category-amount { grid-area: 1 / 2; }
.deduction-breakdown-tile > .deduction-menu-groups {
  grid-area: 2 / 1 / 3 / -1;
  justify-self: stretch;
  margin: 0 10px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
  row-gap: 5px;
}
@media (max-width: 360px) {
  .deductions-page .deduction-categories .deduction-category-tiles > .deduction-breakdown-tile {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 8px;
  }
  .deduction-breakdown-tile > .deduction-category-amount { margin-inline-end: 10px; }
}
.deduction-categories:has(> .deduction-menu-link) {
  --deduction-menu-spacing: clamp(0px, calc(5svh - 30px), min(16px, 3vw));
  row-gap: calc(10px + var(--deduction-menu-spacing) / 2);
}
.deductions-page .deduction-categories > .deduction-menu-link {
  padding-block: calc(7px + var(--deduction-menu-spacing));
}
.deduction-menu-link .deduction-menu-groups {
  row-gap: calc(3px + var(--deduction-menu-spacing) / 3);
  margin-top: calc(3px + var(--deduction-menu-spacing) / 3);
}
@media (max-width: 520px) and (max-height: 680px) {
  main:has(.itemized-deductions-page) { padding-top: 4px; }
  .itemized-deductions-page .deduction-categories { padding: 5px 6px; gap: 3px; }
  .itemized-heading { flex-wrap: nowrap; }
  .itemized-heading h2 { min-width: 0; font-size: 1rem; }
  .itemized-actions { flex: none; }
  .itemized-deductions-page .deduction-method select { min-height: 44px; }
  .deduction-method-advice { margin-top: 4px; padding: 4px 6px; line-height: 1.2; }
  .deduction-method-advice :is(.row, p) { margin: 0; }
  .deduction-method-outcome { display: flex; align-items: center; gap: 6px; }
  .deduction-method-outcome p { flex: 1; min-width: 0; }
  .deduction-method-outcome button { margin: 0; padding: 4px 6px; font-size: 0.8125rem; white-space: nowrap; }
  .itemized-deductions-page .deduction-category-tiles { gap: 4px; }
  .itemized-deductions-page .deduction-categories .tool-link { min-height: 44px; padding-block: 4px; row-gap: 2px; }
  .itemized-deductions-page .deduction-category-hint { line-height: 1.2; }
  .itemized-deductions-page .deduction-category-note { line-height: 1.25; }
}
@media (min-width: 361px) and (max-width: 520px) and (max-height: 680px) {
  .itemized-deductions-page .deduction-method > label { grid-template-columns: auto minmax(0, 1fr); gap: 6px; }
}
.deduction-earners { display: none; }
@media (max-width: 759px) {
  .deduction-earners { display: flex; gap: 5px; margin: 4px 0; }
  .deduction-earners button { flex: 1; min-height: 38px; padding: 5px 8px; }
  .deduction-earners button[aria-pressed="true"] { background: #194e83; color: white; }
  .deduction-layer:has(.deduction-earners)[data-earner="you"] .deduction-inputs > .earner:nth-child(2),
  .deduction-layer:has(.deduction-earners)[data-earner="spouse"] .deduction-inputs > .earner:first-child {
    display: none;
  }
}

@media (max-width: 759px) {
}

.home-summary { max-width: 840px; margin-inline: auto; }
.payroll-tools-menu { position: relative; padding: 0; }
.payroll-tools-menu > summary {
  border: 1px solid #8fa9c2;
  border-radius: 8px;
  list-style: none;
}
.payroll-tools-menu > summary::-webkit-details-marker { display: none; }
.payroll-tools-menu > summary span {
  width: 18px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -5px currentColor, 0 5px currentColor;
}
.payroll-tools-menu > .tool-directory {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(278px, calc(100vw - 32px));
  max-block-size: min(70dvh, max(0px, calc(100dvh - var(--app-header-height) - var(--app-bottom-inset) - 8px)));
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 4px 10px;
  z-index: 5;
  color: var(--ink);
  box-shadow: 0 7px 20px #132c4430;
}
.payroll-tools-menu .tool-link {
  color: inherit;
  padding: 6px 4px;
  min-height: 42px;
}
.payroll-tools-menu .tool-link:first-child { border-top: 0; }
.payroll-tools-menu .tool-link > .tag { flex: none; }
.payroll-tool-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.payroll-tool-mark {
  flex: none;
  color: var(--icon-accent);
}
.payroll-tool-mark:is(.nav-mark-setup, .nav-mark-compare, .nav-mark-pdf, .nav-mark-other-apps) {
  background: currentColor;
  mask: var(--payroll-tool-symbol) center / contain no-repeat;
}
.nav-mark-setup {
  --payroll-tool-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 3H3.8a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h8.4a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-1.7M5.5 2h5v2.5h-5zM5.4 9l1.8 1.8L10.6 7.4'/%3E%3C/svg%3E");
}
.nav-mark-compare {
  --payroll-tool-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 5h11m-3-3 3 3-3 3m4 3H3m3-3-3 3 3 3'/%3E%3C/svg%3E");
}
.nav-mark-pdf {
  --payroll-tool-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 1.5h5l3.5 3.5v8.5a1 1 0 0 1-1 1h-7a1 1 0 0 1-1-1v-11a1 1 0 0 1 1-1zM9 1.5V5h3.5M8 7v4.2m-2-2 2 2 2-2'/%3E%3C/svg%3E");
}
.nav-mark-other-apps {
  --payroll-tool-symbol: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.35'%3E%3Crect x='2' y='2' width='4.5' height='4.5' rx='1'/%3E%3Crect x='9.5' y='2' width='4.5' height='4.5' rx='1'/%3E%3Crect x='2' y='9.5' width='4.5' height='4.5' rx='1'/%3E%3Crect x='9.5' y='9.5' width='4.5' height='4.5' rx='1'/%3E%3C/svg%3E");
}
[data-theme="dark"] .payroll-tools-menu .tool-directory { color: #fff; }

.other-apps-card { max-width: 560px; margin-inline: auto; }
.other-apps-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.other-apps-heading h2 { margin: 0; }
.other-apps-card p { margin: 0 0 14px; }
.other-apps-card :is(button, a) { min-height: 44px; }
.other-apps-card a.tool-link { color: var(--ink); text-decoration: none; align-items: center; }
.other-apps-card a.tool-link:hover { text-decoration: underline; }
.other-apps-back { margin-top: 8px; }

.job-comparison {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.job-comparison caption { text-align: left; font-size: 16px; font-weight: 650; padding-bottom: 8px; }
.job-comparison th, .job-comparison td { padding: 6px 3px; border-bottom: 1px solid var(--rule); }
.job-comparison th:first-child { width: 31%; text-align: left; }
.job-comparison td, .job-comparison th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.comparison-cell-label { display: none; }

#results > .panel {
  --result-padding: clamp(12px, 2.6vw, 22px);
  padding: var(--result-padding);
}
.take-home-highlight {
  padding: 8px 10px;
  border: 1px solid #c8e5da;
  border-radius: 9px;
  background: #e6f5ef;
}
[data-theme="dark"] .take-home-highlight {
  background: #173b37;
  border-color: #3e6c62;
}
.take-home-highlight .amount {
  font-size: clamp(1.625rem, 7vw, 2.8rem);
  margin: 2px 0 0;
  min-width: 0;
}
.take-home-values {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
}
.effective-total-rate {
  flex: none;
  margin: 0;
  text-align: end;
  line-height: 1.2;
}
.effective-total-rate dt { font-size: 0.75rem; }
.effective-total-rate dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.calculator-preview {
  display: grid;
  gap: 10px;
}
.calculator-preview > .note { margin: 0; }
.calculator-preview .out {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 12px;
}
.calculator-preview-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: 8px;
}
.calculator-preview-actions button {
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 8px 6px;
  font-size: 0.875rem;
}
.summary-context {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  border-block: 1px solid var(--rule);
  margin-block: 10px;
  padding-block: 6px;
}
.summary-context dl {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0;
}
.summary-context dl > div { max-inline-size: 100%; overflow-wrap: break-word; }
.summary-context dl > div:last-child { flex: 1 1 min-content; }
.summary-context dt { color: var(--muted); font-size: 0.8125rem; }
.summary-context dd { margin: 0; font-size: 0.875rem; font-weight: 650; }
.summary-context button {
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 5px 9px;
  font-size: 0.8125rem;
}
@media (max-width: 450px) {
  .summary-context button { max-inline-size: 7rem; }
}
.pay-metrics {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 8px;
}
.pay-metrics h3 {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  column-gap: 8px;
  margin: 0 0 3px;
  padding-inline: 6px;
  font-size: 0.875rem;
}
.pay-metrics h3 small { color: var(--muted); font-size: 0.8125rem; font-weight: 650; }
.pay-metrics .row { margin: 0; padding: 4px 6px; font-size: 0.875rem; }
.pay-metrics .deduction-summary-link { margin-block: 2px; padding: 5px; }
.pay-metrics > .row:last-child,
.gross-pay-breakdown > .row:last-child { border-top: 1px solid var(--rule); padding-top: 6px; font-weight: 700; }
@media (max-width: 759px) {
  main:has(.home-summary) { padding-top: 6px; }
  .home-summary .pay-metrics { padding-block: 4px; }
  .home-summary #results > .panel > .row { margin-block: 7px; }
}
.seg button { border-radius: 0; }
.seg button:first-child { border-radius: 8px 0 0 8px; }
.seg button:last-child { border-radius: 0 8px 8px 0; }
.seg button:focus-visible { position: relative; z-index: 1; }
.seg.take-home-periods {
  flex-wrap: wrap;
  gap: 4px;
  margin-block: 9px;
}
.seg.take-home-periods > button {
  flex: 1 0 calc((100% - 12px) / 4);
  min-width: max-content;
  min-height: 44px;
  padding: 5px 2px;
  margin-left: 0;
  border-radius: 8px;
}
@media (max-width: 759px) and (max-height: 680px) {
  .home-summary .take-home-periods { margin-block: 5px; }
  .home-summary .summary-context { margin-block: 6px; }
  .home-summary .gross-pay-breakdown > .row:not(:last-child) { padding-block: 2px; }
}
@media (max-width: 900px) {
  .seg.take-home-periods:is(.wide-period-values, .comparison-periods) > button { flex-basis: calc((100% - 4px) / 2); }
}
@media (max-width: 389px) {
  .seg.take-home-periods > button { flex-basis: calc((100% - 4px) / 2); }
}
@media (max-width: 390px) {
  .retirement-fields:has(input[data-long-number]) {
    grid-template-columns: minmax(0, 1fr);
  }
  :is(.salary-pair, .bonus-pair, .deduction-fields, .hourly-settings) > .numeric-field:has(input[data-long-number]) {
    grid-column: 1 / -1;
  }
}
@media (max-width: 360px) {
  .legend { gap: 5px; grid-template-columns: 10px minmax(0, 1fr) auto auto; }
  .numeric-control > input[type="text"] { padding-inline-start: 8px; }
}

.legend > :last-child { text-align: right; }
[data-theme="dark"] button.primary { background: #245a92; }

@media (min-width: 760px) {
  header { padding-block: 22px; }
  nav { gap: 4px; padding-block: 5px; }
}

.numeric-field {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  margin: 12px 0;
}
.salary-inputs .numeric-field { margin: 6px 0 0; }
.deduction-layer .numeric-field { margin: 4px 0; }
.numeric-field > label { margin: 0; }
.compact-field-label { display: none; }
.numeric-control { position: relative; margin-top: 5px; }
.salary-inputs .numeric-control { margin-top: 2px; }
.deduction-layer .numeric-control { margin-top: 3px; }
.numeric-control > input[type="text"] {
  margin-top: 0;
  padding-inline-end: 36px;
  font-variant-numeric: tabular-nums;
}
.numeric-control > .numeric-clear {
  position: absolute;
  right: 1px;
  bottom: 1px;
  height: calc(100% - 2px);
  width: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #435a70;
  font-size: 20px;
  line-height: 1;
}
.numeric-control > .numeric-clear:hover { color: #132c44; background: #e7eff9; }
.numeric-clear:focus-visible { outline-offset: -4px; }
.numeric-control > input:placeholder-shown + .numeric-clear { visibility: hidden; }

.hourly-extra-row {
  margin-block: 6px 10px;
  padding-block: 4px 8px;
  border-bottom: 1px solid var(--rule);
}
.hourly-extra-row button,
.salary-inputs details > button { padding: 6px 10px; margin-top: 6px; }
.hourly-status { margin: 4px 0; }
.hourly-status:empty { display: none; }
.hourly-help { margin: 6px 0; color: var(--muted); font-size: 0.875rem; }
.earnings-breakdown { border-top: 1px solid var(--rule); }

.bonus-entry { --bonus-control-gap: 5px; }
.salary-inputs .bonus-entry { --bonus-control-gap: 2px; }
.comparison-inputs .bonus-entry { --bonus-control-gap: 3px; }
.bonus-pair .numeric-field, .bonus-unit-field { margin-block: 6px 0; }
.bonus-entry .numeric-control > input[type="text"] { min-height: 44px; }
.bonus-unit-field {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-inline-size: 0;
  font-size: 0.875rem;
  font-weight: 650;
}
.bonus-unit-field > .entry-unit-buttons { margin-block-start: var(--bonus-control-gap); }
.hourly-settings {
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(6.25rem, 1fr);
  row-gap: 0;
}
.hourly-settings > label { margin-block: 6px 0; }
.hourly-settings :is(.bonus-entry, .bonus-pair) { display: contents; }
.hourly-settings .bonus-preview { grid-column: 1 / -1; }
.hourly-settings input, .hourly-settings select { padding-inline-start: 7px; }
.bonus-preview {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8125rem;
}
.bonus-preview output { font-weight: 650; }
@media (max-width: 390px) {
  .bonus-pair:has(input[data-long-number]) > .bonus-unit-field { grid-column: 1 / -1; }
}
@media (max-width: 360px) {
  .hourly-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hourly-settings > label { grid-column: 1 / -1; }
}

#app[data-setup] nav { display: none; }
.setup-card { max-width: 560px; margin-inline: auto; }
.setup-card select:required:invalid,
.setup-card select option:disabled { color: #535f6b; }
.setup-card select option:not(:disabled) { color: #132c44; }
.setup-progress {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 650;
}
.setup-card h2 { margin: 0 0 8px; }
.setup-card h2 + p { margin: 0 0 12px; }
.setup-card .check { margin-block: 16px; }
.setup-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.setup-actions button { min-height: 44px; }
.setup-actions .primary { flex: 1 1 auto; width: auto; margin: 0; }
.setup-add-deductions { width: 100%; min-height: 44px; margin-top: 8px; }
.pro-plans { display: grid; gap: 8px; }
.pro-plans button { min-height: 44px; }
.setup-pro-card h3 { margin: 12px 0 6px; }
.setup-pro-actions { display: grid; gap: 8px; margin-top: 14px; }
.setup-pro-actions button { min-height: 44px; margin: 0; }
.setup-pro-note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.setup-card .row { gap: 8px; }
.setup-card .row strong { text-align: end; }
.setup-estimate .row { margin: 0; }
.setup-pay-guidance { margin: 6px 0; color: var(--muted); font-size: 0.8125rem; }

.credit-layer .numeric-field > label { margin: 0; }
.deduction-layer-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.deduction-layer-heading h3 { margin: 0; }
.deduction-frequency {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.deduction-layer .deduction-frequency select { margin: 0; }

.comparison-page h2 { margin: 0; font-size: 1.3125rem; }
.comparison-workspace { display: grid; gap: 8px; }
.comparison-workspace > * { min-width: 0; }
.comparison-inputs, .comparison-summary, .comparison-result { padding: 10px 12px; margin: 0; }
.comparison-highlight[data-trend="neutral"] {
  background: var(--paper);
  border-color: var(--rule);
}
.comparison-highlight[data-trend="neutral"] .amount { color: var(--ink); }
.comparison-highlight[data-trend="decrease"] {
  background: #fceced;
  border-color: #dca9af;
}
.comparison-highlight[data-trend="decrease"] .amount { color: #952f37; }
[data-theme="dark"] .comparison-highlight[data-trend="decrease"] {
  background: #452b35;
  border-color: #855561;
}
[data-theme="dark"] .comparison-highlight[data-trend="decrease"] .amount { color: #ffc0bc; }
.comparison-take-home {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--rule);
  margin: 6px 0 0;
  padding-top: 5px;
}
.comparison-take-home > div { flex: 1 0 calc(50% - 4px); min-width: max-content; }
.comparison-take-home dt { color: var(--muted); font-size: 0.8125rem; }
.comparison-take-home dd {
  margin: 1px 0 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.comparison-summary .comparison-periods { margin-bottom: 0; }
.comparison-inputs { --paired-control-size: 40px; }
.comparison-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
  margin-bottom: 8px;
}
.comparison-heading button { min-height: 44px; padding: 5px 8px; font-size: 0.8125rem; }
.comparison-inputs .salary-pair { row-gap: 4px; }
.comparison-inputs :is(label, .numeric-field) { margin-block: 4px 0; }
.comparison-inputs .bonus-unit-field { margin-block-start: 4px; }
.comparison-inputs .numeric-field > label { margin: 0; }
.comparison-inputs :is(.numeric-control, label > select) { margin-top: 3px; }
.comparison-inputs details { margin-top: 8px; font-size: 0.8125rem; }
.comparison-inputs details p { margin: 4px 0 0; }
.comparison-result .job-comparison :is(th, td) { padding-block: 4px; }
@media (max-width: 900px) {
  .job-comparison, .job-comparison :is(caption, thead, tbody) { display: block; }
  .job-comparison thead tr, .job-comparison tbody tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 6px;
  }
  .job-comparison tbody tr { padding: 5px 3px; border-bottom: 1px solid var(--rule); }
  .comparison-result .job-comparison :is(th, td) { padding: 1px 0; border: 0; }
  .job-comparison thead { border-bottom: 1px solid var(--rule); padding-inline: 3px; }
  .job-comparison thead th:first-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .job-comparison tbody th:first-child { grid-column: 1 / -1; width: auto; }
}
@media (max-width: 379px) {
  .comparison-result .job-comparison thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .job-comparison tbody tr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "name change" "current proposed";
    align-items: start;
  }
  .job-comparison tbody th:first-child { grid-area: name; }
  .job-comparison tbody td { text-align: start; }
  .job-comparison tbody td:nth-child(2) { grid-area: current; }
  .job-comparison tbody td:nth-child(3) { grid-area: proposed; }
  .job-comparison tbody td:last-child { grid-area: change; text-align: end; }
  .comparison-cell-label { display: block; color: var(--muted); font-size: 0.75rem; }
  .comparison-cell-label::before { content: attr(data-label); }
}
@media (min-width: 760px) {
  .comparison-workspace {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    grid-template-areas: "inputs summary" "inputs breakdown";
    align-items: start;
    gap: 12px;
  }
  .comparison-inputs { grid-area: inputs; }
  #job-comparison-summary { grid-area: summary; }
  #job-comparison-results { grid-area: breakdown; }
}
@media (max-width: 759px) {
  main:has(.comparison-page) { padding-top: 10px; }
}

@media (max-width: 520px) {
  main:has(:is(.compact-hourly, .compact-joint)) { padding-top: 4px; }
  .salary-inputs:is(.compact-hourly, .compact-joint) { padding: 7px 10px; margin-bottom: 10px; }
  .compact-hourly .calculator-heading { column-gap: 4px; }
  :is(.compact-hourly, .compact-joint) .calculator-heading h2 { font-size: 1rem; margin: 0; }
  :is(.compact-hourly, .compact-joint) label { margin-block: 3px 0; font-size: 0.8125rem; line-height: 1.2; }
  .compact-hourly .calculator-heading label { margin: 0; white-space: nowrap; }
  .compact-hourly .calculator-heading select { min-height: 36px; }
  .compact-hourly .numeric-field { margin-block: 3px 0; }
  .compact-hourly .numeric-field > label { margin: 0; }
  .compact-hourly .bonus-unit-field { margin-block-start: 3px; font-size: 0.8125rem; line-height: 1.2; }
  .compact-hourly :is(.salary-pair, .hourly-settings) { column-gap: 6px; }
  :is(.compact-hourly, .compact-joint) .full-field-label { display: none; }
  :is(.compact-hourly, .compact-joint) .compact-field-label { display: inline; }
  .compact-hourly > details:not([open]) { padding: 0; }
  .compact-hourly details > summary {
    margin: 0;
    min-height: 34px;
    padding-block: 6px;
    font-size: 0.8125rem;
  }
  .compact-hourly > .row { margin-block: 3px 0; font-size: 0.875rem; }

  .compact-joint {
    --paired-control-size: 40px;
  }
  .compact-joint select { text-overflow: ellipsis; }
  .joint-pay-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 5px;
  }
  .joint-pay-inputs .earner {
    margin: 0;
    padding: 0 6px 5px;
    border-radius: 8px;
  }
  .joint-pay-inputs legend { font-size: 0.875rem; }
  .joint-pay-inputs :is(.salary-pair, .hourly-settings, .bonus-pair) {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .joint-pay-inputs .numeric-field { margin-block: 3px 0; }
  .joint-pay-inputs .numeric-field > label { margin: 0; }
  .joint-pay-inputs .bonus-entry { --bonus-control-gap: 0px; }
  .joint-pay-inputs .bonus-unit-field { margin-block-start: var(--joint-field-gap, 3px); }
  .joint-pay-inputs :is(.pay-type-field, .bonus-unit-field) > span { display: none; }
  .joint-pay-inputs .bonus-preview { margin-block: 3px 0; font-size: 0.75rem; }
  .joint-pay-inputs .bonus-preview > span { display: none; }
  .joint-pay-inputs details { padding: 4px 0 0; }
  .joint-pay-inputs details summary { font-size: 0.8125rem; padding-block: 4px; }
  .joint-pay-inputs .earner > .row { flex-wrap: wrap; gap: 0 6px; margin: 4px 0 0; font-size: 0.8125rem; }
  .joint-pay-inputs .numeric-control > input { padding-inline-end: 26px; font-family: Arial, sans-serif; }
  .joint-pay-inputs .numeric-clear { width: 24px; }

}

@media (min-width: 361px) and (max-width: 520px) {
  .joint-salaries .joint-pay-inputs {
    grid-template-columns: 3.5rem repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .joint-salaries .joint-pay-labels {
    display: grid;
    grid-template-rows: repeat(3, var(--paired-control-size)) repeat(2, 44px);
    align-items: center;
    gap: var(--joint-field-gap, 3px);
    padding-top: calc(1.45 * 0.875rem + var(--joint-field-gap, 3px));
    padding-inline-end: 2px;
    font-size: 0.75rem;
    font-weight: 650;
    line-height: 1.15;
  }
  .joint-salaries .earner { border: 0; padding: 0; }
  .joint-salaries .earner legend { padding: 0; }
  .joint-salaries .earner :is(.salary-pair, .bonus-pair) > label > span,
  .joint-salaries .earner .numeric-field > label {
    display: none;
  }
  .joint-salaries .earner :is(.numeric-control, select) { margin-top: 0; }
}

@media (max-width: 520px) and (max-height: 640px) {
  header { padding-block: 2px; }
  header h1 { font-size: 1.125rem; }
  .tax-year-choice { margin-top: 2px; }
  .tax-year-choice select { min-height: 22px; padding-block: 1px; }
  main:has(.compact-joint) { padding-top: 3px; }
  .salary-inputs.compact-joint { padding-block: 3px; margin-bottom: 4px; }
  .compact-joint { --paired-control-size: 34px; --joint-field-gap: 2px; }
  .compact-joint :is(input, select) { min-height: var(--paired-control-size); }
  .compact-joint label > select {
    appearance: none;
    padding: 0 20px 0 8px;
    background-image: linear-gradient(45deg, transparent 50%, #132c44 50%),
      linear-gradient(135deg, #132c44 50%, transparent 50%);
    background-position: right 11px center, right 7px center;
    background-size: 4px 4px;
    background-repeat: no-repeat;
  }
  .compact-joint .calculator-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .compact-joint .salary-pair > label { line-height: 1.1; }
  .joint-pay-inputs { margin-top: 3px; }
  .joint-pay-inputs :is(label, .numeric-field) { margin-block-start: var(--joint-field-gap); }
  .joint-pay-inputs .numeric-field > label { margin-top: 0; }
  .joint-pay-inputs .numeric-control > input { padding-inline-start: 5px; }
  .joint-pay-inputs .bonus-preview { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

@media (max-width: 360px) {
  .salary-inputs.compact-joint { padding-inline: 8px; }
  .compact-joint .pay-settings {
    --pay-select-start: 4px;
    --pay-select-end: 12px;
    column-gap: 6px;
  }
  .joint-pay-inputs .earner { padding-inline: 0; border-inline: 0; }
  .compact-hourly .hourly-settings {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr) minmax(0, 1fr);
  }
  .compact-hourly .hourly-settings select {
    appearance: none;
    padding-inline: 5px 14px;
    background-image: linear-gradient(45deg, transparent 50%, #132c44 50%),
      linear-gradient(135deg, #132c44 50%, transparent 50%);
    background-position: right 8px center, right 4px center;
    background-size: 4px 4px;
    background-repeat: no-repeat;
  }
}
