:root {
  --canvas: #fbfbfd;
  --card: #fff;
  --ink: #1d1d1f;
  --muted: #86868b;
  --tertiary: #a1a1a6;
  --line: rgba(0, 0, 0, .07);
  --green: #008060;
  --green-soft: #e3f5ec;
  --blue: #0071e3;
  --blue-soft: #edf5fd;
  --amber: #f59e0b;
  --red: #dc2626;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color: var(--ink);
  background: var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Plus Jakarta Sans", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  position: relative;
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 6%, rgba(0, 128, 96, .026), transparent 27%),
    radial-gradient(circle at 88% 18%, rgba(0, 113, 227, .022), transparent 24%),
    var(--canvas);
  font-size: 14px;
  letter-spacing: -.019em;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, .72) 50%, transparent 80%);
  background-size: 220% 100%;
  animation: canvasDrift 18s ease-in-out infinite alternate;
}
button, input, select { font: inherit; }
button, select, summary, a { -webkit-tap-highlight-color: transparent; }
[tabindex]:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid rgba(0, 113, 227, .32); outline-offset: 3px; }
[hidden] { display: none !important; }
::selection { color: #fff; background: var(--green); }

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
}
.skip-link:focus { top: 12px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 50;
  width: min(1216px, calc(100% - 32px));
  min-height: 56px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  transform: translateX(-50%);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 16px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .03);
  backdrop-filter: blur(28px) saturate(180%);
  transition: border-color .3s ease, box-shadow .3s ease, background .3s ease, transform .45s var(--ease), width .45s var(--ease);
  animation: navIn .7s var(--ease) both;
}
.topbar.scrolled {
  width: min(1184px, calc(100% - 48px));
  background: rgba(255, 255, 255, .91);
  border-color: rgba(0, 0, 0, .1);
  box-shadow: 0 18px 44px -14px rgba(0, 0, 0, .16), 0 2px 5px rgba(0, 0, 0, .04);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--ink);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
  transition: transform .3s var(--spring), background .3s ease;
}
.brand strong { font-size: 13px; letter-spacing: -.02em; transition: color .2s ease; }
.brand-status { width: 6px; height: 6px; margin-left: -5px; border-radius: 50%; background: var(--green); }
.brand:hover .brand-icon { transform: scale(1.1); background: var(--green); }
.brand:hover strong { color: var(--green); }
.topbar nav { margin: auto; display: flex; align-items: center; gap: 4px; }
.topbar nav a {
  padding: 7px 14px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.topbar nav a:hover, .topbar nav a.active { color: var(--ink); background: rgba(0, 0, 0, .045); }
.topbar nav a:active { transform: scale(.96); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.top-actions span {
  padding: 6px 12px;
  border: 1px solid rgba(0, 128, 96, .15);
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 700;
}
.top-actions button {
  padding: 8px 16px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.top-actions button:hover { background: #000; box-shadow: 0 5px 14px rgba(0, 0, 0, .16); }
.top-actions button:active { transform: scale(.95); }

main {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 172px 32px 64px;
}
#calculator, #trend, #payroll, #legal { scroll-margin-top: 96px; }
.hero-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 24px;
  align-items: stretch;
}
.card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 4px 24px -1px rgba(0, 0, 0, .05), 0 2px 6px -1px rgba(0, 0, 0, .03);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s ease;
}
.card:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 0, 0, .12);
  box-shadow: 0 18px 38px -10px rgba(0, 0, 0, .08), 0 4px 12px -2px rgba(0, 0, 0, .04);
}
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.is-visible { opacity: 1; transform: translateY(0); transition: opacity .7s var(--ease), transform .7s var(--ease); }

.input-card {
  min-height: 648px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.card-heading {
  min-height: 49px;
  padding-bottom: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.card-heading > div { display: flex; align-items: center; gap: 11px; }
.heading-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 128, 96, .15);
  border-radius: 12px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 17px;
  font-weight: 800;
}
.card-heading h1 { margin: 0; font-size: 14px; line-height: 1.2; }
.card-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.version {
  padding: 4px 8px;
  border: 1px solid rgba(0, 128, 96, .14);
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font: 650 9px "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: -.01em;
}

.mode-switch {
  position: relative;
  margin: 20px 0;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(0, 0, 0, .035);
  border-radius: 12px;
  background: #f2f2f7;
  isolation: isolate;
}
.mode-switch::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  z-index: -1;
  width: calc(50% - 4px);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);
  transition: transform .32s var(--ease);
}
.mode-switch:has(input[value="net"]:checked)::before { transform: translateX(100%); }
.mode-switch legend { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.mode-switch input { position: absolute; opacity: 0; }
.mode-switch label { cursor: pointer; }
.mode-switch span {
  display: block;
  padding: 8px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  transition: color .25s ease, transform .2s ease;
}
.mode-switch label:active span { transform: scale(.97); }
.mode-switch input:checked + span { color: var(--ink); font-weight: 700; }

.label-row { margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; }
.label-row label, .two-fields label, .advanced label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.label-row output { color: var(--green); font: 700 12px "JetBrains Mono", monospace; }
.amount-field {
  height: 49px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 12px;
  background: #f5f5f7;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .025);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.amount-field:hover { border-color: rgba(0, 0, 0, .12); }
.amount-field:focus-within { border-color: var(--green); background: #fff; box-shadow: 0 0 0 4px rgba(0, 128, 96, .12); }
.amount-field > span { color: var(--muted); font-size: 16px; transition: color .2s ease; }
.amount-field:focus-within > span { color: var(--green); }
.amount-field input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.amount-field small { color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.salary-range {
  width: 100%;
  height: 6px;
  margin: 19px 0 14px;
  appearance: none;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(to right, var(--green) var(--range-fill, 10%), #e5e5ea var(--range-fill, 10%));
}
.salary-range::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  appearance: none;
  border: .5px solid rgba(0, 0, 0, .08);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .18), 0 1px 2px rgba(0, 0, 0, .1);
  cursor: pointer;
  transition: transform .2s var(--spring), box-shadow .2s ease;
}
.salary-range::-webkit-slider-thumb:hover { transform: scale(1.17); box-shadow: 0 0 0 6px rgba(0, 128, 96, .14), 0 4px 12px rgba(0, 0, 0, .2); }
.salary-range::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .18); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.presets button {
  padding: 6px 10px;
  border: 1px solid rgba(0, 0, 0, .045);
  border-radius: 8px;
  color: var(--ink);
  background: #f5f5f7;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}
.presets button:hover { border-color: rgba(0, 0, 0, .1); background: #e8e8ed; }
.presets button:active { transform: scale(.95); }
.presets button.active { color: #fff; border-color: var(--green); background: var(--green); box-shadow: 0 2px 8px rgba(0, 128, 96, .2); }
.two-fields { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two-fields select, .advanced select, .advanced input {
  width: 100%;
  height: 40px;
  margin-top: 7px;
  padding: 0 11px;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 11px;
  outline: 0;
  color: var(--ink);
  background: #f5f5f7;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.two-fields select:hover, .advanced select:hover, .advanced input:hover { border-color: rgba(0, 0, 0, .12); }
.two-fields select:focus, .advanced select:focus, .advanced input:focus { border-color: var(--green); background: #fff; box-shadow: 0 0 0 3px rgba(0, 128, 96, .11); }

.bes-row {
  margin-top: 18px;
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(0, 0, 0, .05);
  border-radius: 12px;
  background: #f5f5f7;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.bes-row:hover { border-color: rgba(0, 0, 0, .1); background: #ebebed; transform: scale(.998); }
.bes-row.disabled { opacity: .58; }
.bes-row > div { display: flex; align-items: center; gap: 10px; }
.bes-row p { margin: 0; }
.bes-row i { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(0, 128, 96, .14); border-radius: 8px; color: var(--green); background: var(--green-soft); font-size: 12px; font-style: normal; font-weight: 800; }
.bes-row span { display: block; font-size: 11px; font-weight: 700; }
.bes-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.switch { position: relative; width: 34px; height: 20px; }
.switch input { position: absolute; opacity: 0; }
.switch b { position: absolute; inset: 0; border-radius: 999px; background: #d6d6da; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .04); cursor: pointer; transition: background .25s ease; }
.switch b::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); transition: transform .25s var(--spring); }
.switch input:checked + b { background: var(--green); }
.switch input:checked + b::after { transform: translateX(14px); }

.advanced { margin-top: 14px; border-top: 1px solid rgba(0, 0, 0, .06); border-bottom: 1px solid rgba(0, 0, 0, .06); }
.advanced summary { min-height: 43px; padding: 11px 0; display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary span { font-size: 11px; font-weight: 800; }
.advanced summary small { margin-left: auto; color: var(--muted); font-size: 9px; }
.advanced summary::after { content: "+"; margin-left: 8px; color: var(--muted); font-size: 15px; transition: transform .3s var(--ease); }
.advanced[open] summary::after { transform: rotate(45deg); }
.advanced[open] summary span { color: var(--green); }
.advanced[open] { margin-inline: -10px; padding-inline: 10px; border-radius: 12px; background: linear-gradient(180deg, rgba(227, 245, 236, .28), transparent 72%); }
.advanced-grid, .agi-grid { padding: 4px 0 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; animation: revealDetails .35s var(--ease); }
.agi-grid { padding-top: 0; }
.monthly-open { width: 100%; margin: 0 0 14px; padding: 11px 12px; display: flex; justify-content: space-between; border: 1px solid rgba(0,0,0,.08); border-radius: 11px; color: var(--ink); background: #f7f7f9; font-size: 10px; font-weight: 750; cursor: pointer; }
.monthly-open span { color: var(--green); font-weight: 650; }
.legal-line { margin-top: auto; padding: 18px 0 9px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 9px; }
.legal-line strong { display: inline-flex; align-items: center; gap: 6px; color: var(--green); }
.legal-line strong i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(0, 128, 96, .08); }
.error { margin: 6px 0 0; color: var(--red); font-size: 10px; }

.result-column { display: grid; grid-template-rows: 1fr auto; gap: 16px; }
@media (min-width: 1021px) and (min-height: 780px) { .result-column { position: sticky; top: 92px; align-self: start; } }
.result-card { min-height: 527px; padding: 32px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.result-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 35% 34%, rgba(0, 128, 96, .09), transparent 42%);
}
.result-card.is-updating::after { animation: surfaceUpdate .65s var(--ease); }
.result-head { padding-bottom: 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(0, 0, 0, .06); }
.result-head > div { display: flex; align-items: center; gap: 10px; }
.result-head i, .section-head p i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--green); }
.result-head span { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.result-head b { padding: 4px 9px; border: 1px solid rgba(0, 128, 96, .14); border-radius: 999px; color: var(--green); background: var(--green-soft); font: 600 10px "JetBrains Mono", monospace; }
.result-head label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.result-head select { height: 31px; padding: 0 10px; border: 1px solid rgba(0, 0, 0, .06); border-radius: 8px; outline: 0; background: #f5f5f7; font-size: 10px; font-weight: 700; cursor: pointer; }
.hero-result { padding: 26px 0 23px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; }
.hero-result span, .cost-box span, .mini-results span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.net-label { display: flex; align-items: center; gap: 8px; }
.net-label em { padding: 4px 8px; border: 1px solid rgba(0, 128, 96, .16); border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 9px; font-style: normal; font-weight: 800; }
.hero-result > div > strong { display: inline-block; margin-top: 8px; font-size: clamp(42px, 5vw, 60px); line-height: .95; letter-spacing: -.065em; font-variant-numeric: tabular-nums; }
.hero-result > div > small { margin-left: 9px; color: var(--muted); font-size: 11px; font-weight: 500; }
.cost-box { min-width: 205px; padding: 15px 17px; border: 1px solid rgba(0, 0, 0, .045); border-radius: 16px; background: rgba(245, 245, 247, .82); text-align: right; transition: background .2s ease, box-shadow .2s ease; }
.cost-box:hover { background: #f2f2f5; box-shadow: 0 4px 12px rgba(0, 0, 0, .04); }
.cost-box strong { display: block !important; margin-top: 5px; font-size: 28px !important; letter-spacing: -.04em !important; }
.cost-box small { display: block; margin: 5px 0 0 !important; color: var(--green) !important; font-size: 10px !important; }
.composition { margin-top: auto; padding: 19px 0 16px; border-top: 1px solid rgba(0, 0, 0, .06); }
.composition > div:first-child { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 600; }
.composition > div strong { color: var(--ink); font: 600 10px "JetBrains Mono", monospace; }
.bar { height: 10px; margin-top: 9px; padding: 2px; display: flex; gap: 2px; overflow: hidden; border-radius: 999px; background: #f0f0f2; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06); }
.bar i { height: 100%; border-radius: 999px; transition: width .55s var(--ease); }
.bar i:nth-child(1) { background: var(--green); }
.bar i:nth-child(2) { background: var(--blue); }
.bar i:nth-child(3) { background: #ff453a; }
.composition ul { margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; list-style: none; color: var(--muted); font-size: 9px; font-weight: 600; }
.composition li::before { content: ""; width: 7px; height: 7px; margin-right: 6px; display: inline-block; border-radius: 50%; }
.composition .net::before { background: var(--green); }
.composition .sgk::before { background: var(--blue); }
.composition .tax::before { background: #ff453a; }
.metrics-grid { padding-top: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; border-top: 1px solid rgba(0, 0, 0, .06); }
.metrics-grid article { padding: 13px; border: 1px solid rgba(0, 0, 0, .045); border-radius: 16px; background: rgba(245, 245, 247, .72); transition: transform .2s ease, background .2s ease, border-color .2s ease; }
.metrics-grid article:hover { transform: translateY(-2px); border-color: rgba(0, 0, 0, .09); background: #f0f0f4; }
.result-card.is-updating .metrics-grid article { animation: metricSettle .45s var(--ease) both; }
.result-card.is-updating .metrics-grid article:nth-child(2) { animation-delay: 30ms; }
.result-card.is-updating .metrics-grid article:nth-child(3) { animation-delay: 60ms; }
.result-card.is-updating .metrics-grid article:nth-child(4) { animation-delay: 90ms; }
.metrics-grid span { display: block; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.metrics-grid strong { display: block; margin: 7px 0 3px; font-size: 15px; font-variant-numeric: tabular-nums; }
.metrics-grid small { color: var(--muted); font-size: 8px; }
.metrics-grid .tax-metric { border-color: rgba(220, 38, 38, .12); background: rgba(255, 241, 242, .75); }
.tax-metric span, .tax-metric strong, .tax-metric small { color: var(--red); }
.mini-results { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mini-results article { min-height: 105px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; }
.mini-results strong { display: block; margin-top: 6px; font-size: 20px; font-variant-numeric: tabular-nums; }
.mini-results small { display: block; margin-top: 4px; color: var(--green); font-size: 9px; font-weight: 700; }
.mini-results article > i { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(0, 128, 96, .14); border-radius: 12px; color: var(--green); background: var(--green-soft); font-size: 16px; font-style: normal; transition: transform .3s var(--spring); }
.mini-results article:nth-child(2) > i { border-color: rgba(0, 0, 0, .05); color: var(--muted); background: #f5f5f7; }
.mini-results article:hover > i { transform: scale(1.1) rotate(-3deg); }

.trend-card { margin-top: 104px; padding: 32px; position: relative; }
.trend-card::before, .legal-section::before { content: ""; position: absolute; top: -41px; left: 0; right: 0; height: 1px; background: rgba(0, 0, 0, .06); }
.section-head { padding-bottom: 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid rgba(0, 0, 0, .06); }
.section-head p { margin: 0 0 6px; display: flex; align-items: center; gap: 7px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.section-head p i.dark { background: var(--ink); }
.section-head h2 { margin: 0; font-size: 24px; line-height: 1.15; letter-spacing: -.04em; }
.section-head small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.bracket-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.bracket-legend span, .chart-month b, .rate-pill { padding: 5px 9px; border: 1px solid rgba(0, 0, 0, .06); border-radius: 999px; font: 700 9px "JetBrains Mono", monospace; }
.rate-15 { color: var(--green); background: var(--green-soft); }
.rate-20 { color: var(--blue); background: var(--blue-soft); }
.rate-25, .rate-27 { color: #b45309; background: #fff4e5; }
.rate-30, .rate-35, .rate-40 { color: var(--red); background: #fef2f2; }
.chart {
  height: 350px;
  margin-top: 28px;
  padding: 19px 14px 13px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  align-items: stretch;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 87px, rgba(0, 0, 0, .045) 88px, transparent 89px);
}
.chart-month { min-width: 0; padding: 0; border: 0; display: grid; grid-template-rows: 29px 1fr 24px; justify-items: center; align-items: end; color: inherit; background: transparent; cursor: pointer; position: relative; }
.chart-month::after {
  content: attr(data-value);
  position: absolute;
  top: 37px;
  z-index: 3;
  padding: 6px 8px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 9px;
  color: #fff;
  background: rgba(29, 29, 31, .92);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .13);
  font: 650 9px "JetBrains Mono", ui-monospace, monospace;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(5px) scale(.96);
  transition: opacity .18s ease, transform .25s var(--ease);
  pointer-events: none;
}
.chart-month:hover::after, .chart-month:focus-visible::after { opacity: 1; transform: translateY(0) scale(1); }
.chart-month.inactive::after { display: none; }
.chart-month b { padding: 4px 7px; transition: transform .25s var(--spring), box-shadow .25s ease; }
.chart-month .column { width: min(34px, 64%); min-height: 4px; transform-origin: bottom; border-radius: 18px 18px 6px 6px; background: linear-gradient(180deg, #34d399, var(--green)); box-shadow: inset 0 1px rgba(255, 255, 255, .45); animation: barGrow .8s var(--ease) both; transition: height .5s var(--ease), transform .25s var(--spring), filter .2s ease, box-shadow .25s ease; }
.chart-month:nth-child(2) .column { animation-delay: 40ms; }.chart-month:nth-child(3) .column { animation-delay: 80ms; }.chart-month:nth-child(4) .column { animation-delay: 120ms; }.chart-month:nth-child(5) .column { animation-delay: 160ms; }.chart-month:nth-child(6) .column { animation-delay: 200ms; }.chart-month:nth-child(7) .column { animation-delay: 240ms; }.chart-month:nth-child(8) .column { animation-delay: 280ms; }.chart-month:nth-child(9) .column { animation-delay: 320ms; }.chart-month:nth-child(10) .column { animation-delay: 360ms; }.chart-month:nth-child(11) .column { animation-delay: 400ms; }.chart-month:nth-child(12) .column { animation-delay: 440ms; }
.chart-month.rate20 .column { background: linear-gradient(180deg, #57a5ff, var(--blue)); }
.chart-month.rate27 .column { background: linear-gradient(180deg, #ffc42d, #ef8f00); }
.chart-month.rate35 .column, .chart-month.rate40 .column { background: linear-gradient(180deg, #fb7185, var(--red)); }
.chart-month:hover .column { transform: scaleX(1.1) scaleY(1.025); filter: brightness(1.05) saturate(1.08); box-shadow: 0 6px 18px rgba(0, 128, 96, .22); }
.chart-month:hover b, .chart-month.active b { transform: translateY(-3px); box-shadow: 0 3px 10px rgba(0, 0, 0, .08); }
.chart-month.active .column { outline: 3px solid rgba(0, 128, 96, .15); outline-offset: 3px; }
.chart-month > span { color: var(--muted); font-size: 9px; font-weight: 700; transition: color .2s ease, transform .2s ease; }
.chart-month:hover > span, .chart-month.active > span { color: var(--ink); transform: scale(1.08); }
.chart-month.inactive { opacity: .25; cursor: default; }
.chart-month.inactive:hover .column { transform: none; filter: none; box-shadow: none; }
.chart-note { margin-top: 16px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid rgba(0, 0, 0, .045); border-radius: 16px; color: var(--muted); background: rgba(245, 245, 247, .82); font-size: 10px; }
.chart-note b { color: var(--ink); }
.chart-note small { color: var(--muted); font: 9px "JetBrains Mono", monospace; white-space: nowrap; }

.payroll-section { margin-top: 64px; }
.payroll-section .section-head { padding-bottom: 0; align-items: flex-end; border: 0; }
.table-actions { display: flex; gap: 8px; }
.table-actions button, .table-actions a { padding: 9px 14px; border: 1px solid rgba(0, 0, 0, .08); border-radius: 11px; color: var(--ink); background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .04); font-size: 10px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.table-actions button:hover, .table-actions a:hover { border-color: rgba(0, 0, 0, .15); background: #f5f5f7; box-shadow: 0 4px 12px rgba(0, 0, 0, .06); }
.table-actions button:active, .table-actions a:active { transform: scale(.95); }
th abbr { text-decoration: none; cursor: help; }
.table-card { margin-top: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: 0 4px 24px -1px rgba(0, 0, 0, .05), 0 2px 6px -1px rgba(0, 0, 0, .03); }
.table-scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, .16) transparent; }
table { width: 100%; border-collapse: collapse; color: var(--ink); font-size: 10px; white-space: nowrap; }
th { padding: 14px 13px; color: var(--muted); background: rgba(245, 245, 247, .82); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-align: right; text-transform: uppercase; }
th:first-child, td:first-child { padding-left: 16px; text-align: left; }
th:last-child, td:last-child { padding-right: 16px; }
td { padding: 14px 13px; border-top: 1px solid rgba(0, 0, 0, .045); text-align: right; font-family: "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; transition: background .2s ease; }
tbody tr:nth-child(even) td { background: #fafafc; }
tbody tr { cursor: pointer; }
tbody tr:hover td, tbody tr.active td { background: #f0fdf4; }
tbody tr.active td:first-child { box-shadow: inset 4px 0 var(--green); }
tbody tr.active td { animation: rowSelect .35s var(--ease); }
tbody td:nth-child(7) { color: #d52b3f; }
tbody td:nth-child(9) { color: var(--ink); font-weight: 800; }
tfoot { color: #fff; background: var(--ink); }
tfoot td { padding-top: 17px; padding-bottom: 17px; border: 0; font-weight: 700; }
tfoot td:nth-child(7) { color: #fda4af; }
tfoot td:nth-child(9) { color: #34d399; font-size: 11px; }

.legal-section { margin-top: 104px; position: relative; }
.legal-title { text-align: center; }
.legal-title h2 { margin: 0; font-size: 22px; letter-spacing: -.04em; }
.legal-title p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.tax-cards { margin-top: 28px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.tax-cards article { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 4px 24px -1px rgba(0, 0, 0, .045); cursor: default; transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s ease; }
.tax-cards article:hover { transform: translateY(-4px); border-color: rgba(0, 128, 96, .28); box-shadow: 0 16px 34px -10px rgba(0, 0, 0, .11); }
.tax-cards article span { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.tax-cards article strong { display: block; margin: 9px 0 5px; font-size: 22px; transition: color .25s ease; }
.tax-cards article p, .tax-cards article small { margin: 0; color: var(--muted); font-size: 9px; }
.tax-cards article small { display: block; margin-top: 8px; color: var(--tertiary); }
.exemption-note { margin-top: 16px; padding: 15px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 4px 18px -4px rgba(0, 0, 0, .04); font-size: 10px; }
.exemption-note > span { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: var(--green); background: var(--green-soft); }
.exemption-note p { margin: 0; color: var(--muted); }
.exemption-note a { margin-left: auto; color: var(--green); font-weight: 700; text-decoration: none; white-space: nowrap; }
.exemption-note a:hover { text-decoration: underline; }

footer { padding: 56px max(32px, calc((100% - 1216px) / 2)) 38px; color: #aaa; background: #161617; border-top: 1px solid rgba(255, 255, 255, .1); }
.footer-grid { padding-bottom: 40px; display: grid; grid-template-columns: 2.1fr 1fr 1fr 1fr; gap: 52px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.footer-brand { color: #fff; }
.footer-brand .brand-icon { color: var(--ink); background: #fff; }
.footer-grid > div { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.footer-grid > div > strong { color: #fff; font-size: 10px; text-transform: uppercase; }
.footer-grid a, .footer-grid span, .footer-grid p { margin: 0; color: #aaa; font-size: 9px; line-height: 1.65; text-decoration: none; }
.footer-grid a:hover { color: #34d399; }
.footer-grid .verified { padding: 5px 9px; border: 1px solid rgba(52, 211, 153, .2); border-radius: 999px; color: #34d399; }
.copyright { margin: 24px 0 0; display: flex; justify-content: space-between; color: #6f6f73; font-size: 8px; }
.utility-actions { margin-top: 2px; display: flex; justify-content: flex-end; gap: 6px; }
.utility-actions button { padding: 7px 10px; border: 1px solid rgba(0,0,0,.06); border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.72); font-size: 9px; font-weight: 700; cursor: pointer; transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease; }
.utility-actions button:hover { color: var(--green); border-color: rgba(0,128,96,.22); background: var(--green-soft); }
.utility-actions button:active { transform: scale(.95); }
.utility-actions button span { margin-right: 4px; font-size: 11px; }
dialog { width: min(820px, calc(100% - 40px)); max-height: calc(100vh - 60px); padding: 0; overflow: hidden; border: 1px solid rgba(0,0,0,.1); border-radius: 22px; background: #fff; box-shadow: 0 32px 80px rgba(0,0,0,.2); }
dialog::backdrop { background: rgba(20,20,22,.35); backdrop-filter: blur(8px); }
dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 60px); }
dialog header, dialog form > footer { padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #fff; }
dialog header { border-bottom: 1px solid var(--line); }
dialog header div { display: grid; gap: 3px; }
dialog header strong { font-size: 15px; }
dialog header small { color: var(--muted); font-size: 10px; }
dialog header button { width: 30px; height: 30px; border: 0; border-radius: 50%; color: var(--muted); background: #f2f2f7; cursor: pointer; }
dialog form > footer { border-top: 1px solid var(--line); background: #fafafa; }
dialog form > footer button { padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 10px; font-weight: 700; cursor: pointer; }
dialog form > footer .primary { color: #fff; border-color: var(--ink); background: var(--ink); }
.monthly-table { padding: 14px 22px; overflow: auto; display: grid; grid-template-columns: 80px 1fr 1fr; gap: 8px; align-items: center; }
.monthly-table > strong { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.monthly-table label { display: contents; }
.monthly-table label > span { font-size: 10px; font-weight: 700; }
.monthly-table input { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #f7f7f9; }
.history-list { min-height: 180px; padding: 14px 22px; overflow: auto; display: grid; gap: 8px; }
.history-list button { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; }
.history-list button:hover { border-color: rgba(0,128,96,.24); background: var(--green-soft); }
.history-list button span { display: grid; gap: 2px; }
.history-list button small, .history-empty { color: var(--muted); font-size: 9px; }

.value-changed { animation: numberFlash .4s var(--ease); }
.page-ready .input-card { animation: heroIn .75s var(--ease) both; }
.page-ready .result-column { animation: heroIn .75s .08s var(--ease) both; }
@keyframes navIn { from { opacity: 0; transform: translate(-50%, -16px) scale(.985); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes heroIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes numberFlash { from { opacity: .35; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
@keyframes barGrow { from { opacity: 0; transform: scaleY(0); } 65% { transform: scaleY(1.03); } to { opacity: 1; transform: scaleY(1); } }
@keyframes revealDetails { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes surfaceUpdate { 0% { opacity: 0; transform: scale(.96); } 35% { opacity: 1; } 100% { opacity: 0; transform: scale(1.08); } }
@keyframes metricSettle { from { opacity: .55; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rowSelect { from { background: rgba(0, 128, 96, .1); } to { background: #f0fdf4; } }
@keyframes canvasDrift { from { background-position: 10% 0; } to { background-position: 90% 0; } }

@media (max-width: 1020px) {
  .topbar nav { display: none; }
  main { padding-inline: 24px; }
  .hero-grid { grid-template-columns: 1fr; }
  .input-card { min-height: 0; }
  .result-card { min-height: 520px; }
  .tax-cards { grid-template-columns: repeat(3, 1fr); }
  .chart { gap: 7px; }
  .chart-month .column { width: 24px; }
}

@media (max-width: 680px) {
  .topbar { top: 8px; width: calc(100% - 16px); min-height: 54px; padding: 9px 12px; }
  .top-actions span { display: none; }
  .top-actions { margin-left: auto; }
  .brand strong { font-size: 12px; }
  main { padding: 112px 10px 80px; }
  .input-card, .result-card, .trend-card { padding: 20px; }
  .hero-result { grid-template-columns: 1fr; }
  .cost-box { text-align: left; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .mini-results { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .bracket-legend { justify-content: flex-start; }
  .trend-card { margin-top: 88px; overflow: hidden; }
  .chart { height: 300px; overflow-x: auto; grid-template-columns: repeat(12, 48px); }
  .chart-note { align-items: flex-start; flex-direction: column; }
  .table-actions { width: 100%; }
  .tax-cards { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px 24px; }
  .copyright { gap: 10px; flex-direction: column; }
  .two-fields, .advanced-grid, .agi-grid { grid-template-columns: 1fr; }
  .composition ul { gap: 9px; }
  .result-head { align-items: flex-start; gap: 12px; flex-direction: column; }
  .hero-result > div > strong { font-size: 46px; }
}

@media (max-width: 430px) {
  .top-actions button { padding-inline: 12px; }
  .input-card, .result-card, .trend-card { padding: 17px; border-radius: 20px; }
  .metrics-grid, .tax-cards, .footer-grid { grid-template-columns: 1fr; }
  .tax-cards article:last-child { grid-column: auto; }
  .card-heading p { max-width: 150px; }
  .advanced summary small { display: none; }
}

@media print {
  .topbar, .input-card, .table-actions, .legal-section, footer { display: none !important; }
  main { width: 100%; padding: 0; }
  .hero-grid { display: block; }
  .result-column { display: block; }
  .mini-results { margin-top: 12px; }
  .trend-card, .payroll-section { break-inside: avoid; margin-top: 25px; box-shadow: none; }
  .table-card, .card { box-shadow: none; }
}

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