/* Tax suite identity: sage paper, deep ledger ink, jade accent. */
:root {
  --paper: #e8f0e7;
  --paper-deep: #d7e5da;
  --card: #fbfff8;
  --card-soft: #f0f7ee;
  --ink: #10261e;
  --muted: #5b7067;
  --line: #183b2f;
  --soft-line: #bfd2c4;
  --accent: #178c74;
  --accent-dark: #075b4b;
  --accent-soft: #d8f2e7;
  --green: #178c74;
  --green-soft: #d8f2e7;
  --warning: #a9442d;
  --shadow: 6px 6px 0 var(--ink);
  --shadow-soft: 3px 3px 0 var(--ink);
  --radius: 18px;
  --radius-sm: 10px;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-display: "Songti SC", "Noto Serif CJK SC", "STSong", serif;
  --font-mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", "Liberation Mono", monospace;
}

body {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 8% 4%, rgba(23, 140, 116, .14), transparent 24rem),
    radial-gradient(circle at 92% 2%, rgba(7, 91, 75, .09), transparent 28rem),
    linear-gradient(rgba(16, 38, 30, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 38, 30, .035) 1px, transparent 1px);
  background-size: auto, auto, 28px 28px, 28px 28px;
}

::selection { color: var(--card); background: var(--accent-dark); }

.site-header { border-bottom-color: rgba(24, 59, 47, .18); }
.brand-mark {
  color: var(--card);
  background: var(--accent);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  transform: rotate(-2deg);
}
.brand-copy small { color: #49665b; }
.top-nav a::after { background: var(--accent); }

/* Hero */
.tax-hero {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .62fr);
  gap: clamp(46px, 8vw, 104px);
  align-items: center;
  padding-block: clamp(56px, 8vw, 96px) clamp(76px, 9vw, 112px);
}
.tax-hero h1 {
  display: grid;
  justify-items: start;
  margin: 0;
  font-size: clamp(62px, 8.2vw, 116px);
  line-height: .88;
  letter-spacing: -.075em;
}
.tax-hero h1 > span { display: block; }
.tax-hero h1 em {
  display: inline-block;
  margin-top: 18px;
  padding: 0 .13em .06em;
  color: var(--card);
  background: var(--accent);
  border: 2px solid var(--ink);
  box-shadow: 7px 7px 0 var(--accent-dark);
  font-family: var(--font-mono);
  font-size: .48em;
  font-style: normal;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.055em;
  transform: rotate(-2deg);
}
.tax-hero h1 em::after { display: none; }
.tax-hero .hero-lead { max-width: 650px; color: #435b51; }
.hero-facts span { border-color: #8eada0; background: rgba(251, 255, 248, .7); }
.edu-note {
  max-width: 660px;
  margin: 24px 0 0;
  padding: 12px 15px;
  color: #486157;
  background: rgba(251, 255, 248, .62);
  border-left: 4px solid var(--accent);
  border-radius: 0 9px 9px 0;
  font-size: 12px;
  line-height: 1.7;
}
.edu-note strong { color: var(--accent-dark); }

.hero-receipt {
  position: relative;
  min-width: 0;
  padding: clamp(23px, 4vw, 32px);
  color: #eafff7;
  background:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px),
    #102f26;
  background-size: 18px 18px, 18px 18px, auto;
  border: 2px solid var(--ink);
  border-radius: 6px 22px 6px 6px;
  box-shadow: 11px 11px 0 var(--accent);
  transform: rotate(1.2deg);
}
.hero-receipt::before,
.hero-receipt::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.hero-receipt::before { left: -12px; top: 29%; }
.hero-receipt::after { right: -12px; bottom: 26%; }
.receipt-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 13px;
  color: #99c8b8;
  border-bottom: 1px dashed rgba(234, 255, 247, .35);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .11em;
}
.receipt-top b { color: #d9f7eb; font-weight: 500; }
.receipt-kicker {
  margin: 22px 0 15px;
  color: #8fc4b3;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
}
.receipt-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 0;
  color: #b5d2c8;
  font-size: 12.5px;
}
.receipt-row strong {
  color: #f1fff9;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.receipt-rule { margin: 16px 0 17px; border-top: 1px dashed rgba(234, 255, 247, .28); }
.receipt-net-label {
  margin: 0 0 2px;
  color: #8fc4b3;
  font-size: 11px;
}
.receipt-net {
  margin: 0;
  color: #dcfff2;
  font-family: var(--font-mono);
  font-size: clamp(39px, 5.4vw, 58px);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -.07em;
  font-variant-numeric: tabular-nums;
}
.receipt-net span { color: #83baa8; font-size: .58em; }
.receipt-stamp {
  position: absolute;
  right: 26px;
  bottom: 48px;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  color: #b8edda;
  border: 2px solid #6fb7a0;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: .06em;
  transform: rotate(-12deg);
  opacity: .75;
}
.receipt-foot {
  margin: 20px 0 0;
  color: #8fb9aa;
  font-size: 10.5px;
  line-height: 1.6;
}

/* Studio and view switch */
.tax-studio { scroll-margin-top: 24px; }
.studio-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 21px;
  padding-bottom: 17px;
  border-bottom: 1px dashed #9db8aa;
}
.studio-heading h2 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 54px);
  line-height: 1.05;
  letter-spacing: -.05em;
}
.studio-heading > div:first-child > p:last-child {
  max-width: 620px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.view-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 4px;
  background: rgba(251, 255, 248, .72);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  box-shadow: 3px 3px 0 rgba(16, 38, 30, .16);
}
.view-button {
  min-height: 44px;
  padding: 8px 19px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.view-button.is-active {
  color: var(--card);
  background: var(--accent-dark);
  box-shadow: 2px 2px 0 var(--accent);
}

.tax-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr);
  gap: 30px;
  align-items: start;
}
.tax-form { padding: clamp(22px, 3.6vw, 38px); }
.tax-form .card-heading { padding-bottom: 24px; border-bottom: 1px solid var(--soft-line); }
.tax-form .card-heading h2 { font-size: clamp(27px, 3.2vw, 36px); }

.form-block {
  margin-top: 29px;
  padding-top: 27px;
  border-top: 1px dashed var(--soft-line);
}
.form-block.first-block { border-top: 0; }
.block-heading {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 18px;
}
.step-number {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  color: var(--card);
  background: var(--accent-dark);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}
.block-heading h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.25;
}
.block-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.field-label small { color: var(--muted); font-size: 10.5px; font-weight: 500; }
.gross-field .field-label { margin-bottom: 9px; }

.money-input {
  display: flex;
  align-items: stretch;
  min-width: 0;
  overflow: hidden;
  background: #fffef9;
  border: 1.5px solid #7f9b8f;
  border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.money-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 140, 116, .15);
}
.money-input > span:first-child {
  display: grid;
  place-items: center;
  padding-left: 14px;
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}
.money-input input {
  min-width: 0;
  flex: 1;
  width: 100%;
  min-height: 44px !important;
  padding: 9px 13px 9px 7px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.money-input-large > span:first-child { padding-left: 17px; font-size: 25px; }
.money-input-large input {
  min-height: 62px !important;
  padding: 10px 15px 10px 8px !important;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -.035em;
}
.mini-money {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  background: #fffef9;
  border: 1px solid #8da598;
  border-radius: 8px;
}
.mini-money:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(23, 140, 116, .12); }
.mini-money > span:first-child { padding-left: 9px; color: var(--accent-dark); font-size: 12px; font-weight: 700; }
.mini-money input {
  min-height: 44px !important;
  width: 100%;
  min-width: 0;
  padding: 7px 9px 7px 4px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.quick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
}
.quick-label {
  margin: 0 2px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
}
.quick-amount {
  min-height: 44px;
  padding: 7px 13px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #9eb8aa;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.quick-amount:hover { background: var(--accent-soft); border-color: var(--accent); transform: translateY(-1px); }

.special-heading {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
}
.special-total {
  align-self: start;
  padding: 6px 10px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid #9fcdbd;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  white-space: nowrap;
}
.deduction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.deduction-item {
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr);
  gap: 8px 10px;
  min-width: 0;
  padding: 11px;
  background: var(--paper);
  border: 1px solid #b6cbbd;
  border-radius: 12px;
  cursor: text;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.deduction-item:hover { background: #eef7ed; border-color: #80ae9d; }
.deduction-item:focus-within { background: #f5fcf3; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(23, 140, 116, .1); }
.deduction-symbol {
  display: grid;
  grid-row: 1 / 2;
  place-items: center;
  width: 35px;
  height: 35px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid #9ccbbb;
  border-radius: 9px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
}
.deduction-copy { display: grid; min-width: 0; align-content: center; }
.deduction-copy strong { font-size: 12.5px; line-height: 1.35; }
.deduction-copy small { margin-top: 2px; color: var(--muted); font-size: 9.5px; line-height: 1.4; }
.deduction-item .mini-money { grid-column: 1 / -1; }

.tax-form .form-actions { margin-top: 30px; }
.run-button {
  min-width: 210px;
  min-height: 52px;
  color: var(--card);
  background: var(--accent-dark);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 14px;
}
.run-button:hover:not(:disabled) { background: var(--accent); }
.tax-form .form-error,
.tax-form .form-success { margin-top: 14px; }

/* Result payslip */
.payslip {
  position: sticky;
  top: 22px;
  overflow: hidden;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  box-shadow: 7px 7px 0 var(--accent);
}
.payslip-head {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 3.5vw, 32px);
  color: #eafff7;
  background:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px),
    var(--ink);
  background-size: 22px 22px, 22px 22px, auto;
}
.payslip-head::after {
  content: "2026";
  position: absolute;
  right: -9px;
  bottom: -27px;
  color: rgba(216, 242, 231, .055);
  font-family: var(--font-mono);
  font-size: 106px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.08em;
  pointer-events: none;
}
.payslip-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #91bbae;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .11em;
}
.payslip-topline .live-dot { background: #8de1c4; box-shadow: 0 0 0 4px rgba(141, 225, 196, .11); }
.payslip-view { margin-left: auto; color: #bfe2d6; }
.payslip-caption {
  position: relative;
  z-index: 1;
  margin: 25px 0 0;
  color: #a7cdbf;
  font-size: 12px;
}
.payslip-head #result,
.payslip-result {
  position: relative;
  z-index: 1;
  margin: 4px 0 0 !important;
  padding: 0 !important;
  color: #e8fff7 !important;
  background: transparent !important;
  border: 0 !important;
  font-family: var(--font-mono);
  font-size: clamp(45px, 6.2vw, 66px);
  font-weight: 750;
  line-height: 1.06 !important;
  letter-spacing: -.075em;
  white-space: normal !important;
  font-variant-numeric: tabular-nums;
}
.rate-chips {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 19px;
}
.rate-chips > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: #a4cbbd;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(201, 239, 225, .24);
  border-radius: 7px;
  font-size: 10px;
}
.rate-chips b { color: #effff9; font-family: var(--font-mono); font-size: 11px; font-weight: 650; }
.payslip-body { padding: clamp(22px, 3.5vw, 30px); }
.breakdown-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--soft-line);
}
.breakdown-heading h3 { margin: 0; font-family: var(--font-display); font-size: 19px; }
.breakdown-heading span { color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; }
.breakdown-list { margin: 0; }
.breakdown-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(191, 210, 196, .55);
}
.breakdown-list dt { color: var(--muted); font-size: 11.5px; }
.breakdown-list dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.breakdown-list .breakdown-total {
  margin-top: 5px;
  padding: 11px 12px;
  background: var(--accent-soft);
  border: 1px solid #a2d0bf;
  border-radius: 9px;
}
.breakdown-list .breakdown-total dt { color: var(--accent-dark); font-weight: 650; }
.breakdown-list .breakdown-total dd { color: var(--accent-dark); font-size: 14px; font-weight: 750; }
.breakdown-list .breakdown-tax { border-bottom: 0; padding-bottom: 0; }
.breakdown-list .breakdown-tax dt { color: var(--ink); font-weight: 600; }
.breakdown-list .breakdown-tax dd { color: #8e3b24; font-size: 14px; font-weight: 750; }
.formula-box {
  display: grid;
  gap: 4px;
  margin-top: 17px;
  padding: 11px 13px;
  background: var(--paper);
  border: 1px solid var(--soft-line);
  border-radius: 9px;
}
.formula-box span { color: var(--muted); font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .1em; }
.formula-box code { color: var(--ink); font-size: 10.5px; line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }
.result-note { margin: 14px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.7; }
.payslip-foot {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px clamp(22px, 3.5vw, 30px);
  color: var(--muted);
  background: var(--card-soft);
  border-top: 1px solid var(--soft-line);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .04em;
}

/* Premium tools */
.premium-zone {
  margin-top: 68px;
  scroll-margin-top: 24px;
}
.premium-heading { margin-bottom: 23px; }
.premium-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  align-items: start;
}
.premium-work { min-width: 0; padding: clamp(22px, 3.2vw, 32px); }
.work-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.work-heading h3 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: clamp(23px, 2.7vw, 30px);
  line-height: 1.18;
  letter-spacing: -.03em;
}
.premium-work .lock-note { margin-block: 18px; }
.premium-input-row {
  display: flex;
  align-items: stretch;
  gap: 9px;
}
.premium-input-row .money-input { flex: 1; min-width: 0; }
.premium-input-row .button { flex: 0 0 auto; }
.bonus-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 19px;
}
.bonus-option {
  min-width: 0;
  padding: 15px;
  background: var(--paper);
  border: 1px solid #aec7b9;
  border-radius: 11px;
}
.bonus-option:first-child { background: var(--accent-soft); border-color: #9acaba; }
.bonus-option > span { display: block; color: var(--muted); font-size: 10.5px; }
.bonus-option > strong {
  display: block;
  margin: 6px 0 3px;
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: clamp(22px, 2.6vw, 29px);
  line-height: 1.08;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.bonus-option > small { color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.bonus-option > p { margin: 12px 0 0; padding-top: 10px; color: var(--muted); border-top: 1px dashed #a9c1b3; font-size: 10px; }
.bonus-option > p b { display: block; margin-top: 2px; color: var(--ink); font-family: var(--font-mono); font-size: 12px; font-weight: 650; }
.verdict-box {
  margin-top: 13px;
  padding: 12px 14px;
  color: #d9fff0;
  background: #163d31;
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 11px;
  line-height: 1.65;
}

.segment-intro { margin-top: -3px; }
.segment-list { display: grid; gap: 8px; margin-top: 13px; }
.segment-row {
  display: grid;
  grid-template-columns: 26px minmax(100px, 1.15fr) minmax(112px, .85fr) 72px 44px;
  gap: 7px;
  align-items: end;
  padding: 9px;
  background: var(--paper);
  border: 1px solid #b4cbbb;
  border-radius: 10px;
}
.segment-number {
  align-self: center;
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}
.segment-row label { display: grid; min-width: 0; gap: 3px; }
.segment-row label > span:first-child { color: var(--muted); font-size: 8.5px; line-height: 1.2; }
.segment-row input[type="text"],
.segment-row input[type="number"] {
  min-height: 44px;
  padding: 7px 8px;
  border-color: #90aa9c;
  font-family: var(--font-mono);
  font-size: 11px;
}
.segment-row .mini-money input { padding: 7px 6px 7px 2px !important; font-size: 11px; }
.segment-remove {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid #b7cbbf;
  border-radius: 8px;
  font-size: 19px;
  cursor: pointer;
}
.segment-remove:hover { color: #873921; background: #f9e3da; border-color: #bd7d68; }
.segment-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.segment-result { margin-top: 16px; }
.segment-result .empty-state { padding: 20px 14px; background: var(--paper); border-color: #aac1b4; font-size: 11px; }
.segment-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
}
.segment-stats > div {
  min-width: 0;
  padding: 9px;
  background: var(--paper);
  border: 1px solid #b5cbbd;
  border-radius: 8px;
}
.segment-stats span { display: block; color: var(--muted); font-size: 8.5px; }
.segment-stats strong {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.mini-table { font-size: 10.5px; }
.mini-table th,
.mini-table td { padding: 7px 8px; }
.mini-table th { font-size: 8.5px; }
.segment-footnote { margin: 10px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.6; }

/* Cumulative ledger */
.ledger-card {
  margin-top: 28px;
  padding: clamp(22px, 3.2vw, 34px);
}
.ledger-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.ledger-heading h3 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.3vw, 36px);
  line-height: 1.18;
  letter-spacing: -.035em;
}
.ledger-heading > div:first-child > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 11.5px; }
.ledger-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; }
.ledger-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}
.ledger-metrics > div {
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid #b5ccbe;
  border-radius: 9px;
}
.ledger-metrics span { display: block; color: var(--muted); font-size: 9.5px; }
.ledger-metrics strong {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: clamp(15px, 2vw, 20px);
  line-height: 1.2;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.ledger-wrap { border: 1px solid var(--soft-line); border-radius: 10px; }
.ledger-table { min-width: 960px; font-size: 10.5px; }
.ledger-table th {
  position: sticky;
  top: 0;
  color: #eafff7;
  background: var(--ink);
  border-bottom: 1px solid var(--ink);
  font-size: 9px;
  white-space: nowrap;
}
.ledger-table td { padding: 8px 9px; white-space: nowrap; font-family: var(--font-mono); }
.ledger-table tbody tr:nth-child(even) { background: #f5faf2; }
.ledger-table .number-strong { color: var(--accent-dark); font-weight: 700; }
.ledger-table .table-empty {
  padding: 27px 14px;
  color: var(--muted);
  text-align: center;
  font-family: var(--font-sans);
  font-size: 12px;
}
.ledger-note { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }

/* FAQ and supporting sections */
.tax-faq details { background: rgba(251, 255, 248, .78); }
.faq-answer { padding: 15px 18px 18px; }
.faq-answer > p { padding: 0; margin: 0 0 12px; }
.faq-answer > p:last-child { margin-bottom: 0; }
.bracket-table { min-width: 470px; background: var(--card); border: 1px solid var(--soft-line); border-radius: 8px; overflow: hidden; }
.bracket-table th { color: var(--ink); background: var(--paper-deep); border-bottom-color: #9fb9aa; }
.bracket-table td { font-family: var(--font-mono); font-size: 11px; }
.bracket-table td:nth-child(2) { color: var(--accent-dark); font-weight: 700; }
.table-caption { color: var(--muted); font-size: 10.5px !important; line-height: 1.65; }
.unlock-section { margin-block: 54px 44px; }
.premium-map h2 { letter-spacing: -.04em; }
.site-footer { background: var(--ink); }
.footer-base { border-top-color: rgba(255, 255, 255, .12); }

@media (max-width: 980px) {
  .tax-hero { grid-template-columns: 1fr; gap: 42px; }
  .hero-receipt { width: min(100%, 540px); justify-self: end; }
  .tax-layout { grid-template-columns: 1fr; }
  .payslip { position: static; }
  .premium-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .tax-hero { padding-top: 45px; padding-bottom: 70px; }
  .tax-hero h1 { font-size: clamp(53px, 16vw, 78px); }
  .tax-hero h1 em { margin-top: 14px; box-shadow: 5px 5px 0 var(--accent-dark); }
  .hero-receipt { width: 100%; transform: none; box-shadow: 7px 7px 0 var(--accent); }
  .receipt-stamp { right: 18px; bottom: 43px; width: 57px; height: 57px; font-size: 13px; }
  .studio-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .view-switch { align-self: stretch; }
  .view-button { flex: 1; }
  .special-heading { grid-template-columns: 38px minmax(0, 1fr); }
  .special-total { grid-column: 2; justify-self: start; }
  .deduction-grid { grid-template-columns: 1fr; }
  .deduction-item { grid-template-columns: 36px minmax(0, 1fr) minmax(104px, .7fr); align-items: center; }
  .deduction-item .mini-money { grid-column: 3; }
  .bonus-compare { grid-template-columns: 1fr; }
  .premium-input-row { flex-direction: column; }
  .premium-input-row .button { width: 100%; }
  .segment-row { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .segment-row label:nth-of-type(3) { grid-column: 2 / 4; }
  .segment-remove { grid-column: 4; grid-row: 1 / span 2; height: 44px; width: 44px; align-self: center; }
  .ledger-heading { flex-direction: column; }
  .ledger-actions { width: 100%; }
  .ledger-actions .button { flex: 1 1 140px; }
  .ledger-metrics { grid-template-columns: 1fr; }
  .payslip-head #result, .payslip-result { font-size: clamp(43px, 12vw, 60px); }
}

@media (max-width: 460px) {
  .tax-hero h1 { font-size: clamp(49px, 15.4vw, 67px); }
  .tax-hero h1 em { font-size: .45em; }
  .hero-receipt { padding: 21px; }
  .receipt-net { font-size: clamp(37px, 11vw, 47px); }
  .receipt-stamp { display: none; }
  .edu-note { font-size: 11px; }
  .tax-form { padding: 18px; }
  .money-input-large input { font-size: 27px; }
  .quick-label { flex-basis: 100%; }
  .quick-amount { flex: 1 1 calc(50% - 7px); }
  .deduction-item { grid-template-columns: 35px minmax(0, 1fr); }
  .deduction-item .mini-money { grid-column: 1 / -1; }
  .run-button { width: 100%; min-width: 0; }
  .payslip-head, .payslip-body { padding-left: 19px; padding-right: 19px; }
  .payslip-foot { padding-inline: 19px; }
  .premium-work, .ledger-card { padding: 19px; }
  .segment-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segment-row { grid-template-columns: 22px minmax(0, 1fr) 44px; }
  .segment-row label:nth-of-type(2),
  .segment-row label:nth-of-type(3) { grid-column: 2 / 3; }
  .segment-remove { grid-column: 3; grid-row: 1 / span 3; }
  .segment-actions .button { flex: 1 1 100%; }
  .faq-answer { padding-inline: 14px; }
  .bonus-option > strong { font-size: 22px; }
}

@media (max-width: 700px), (pointer: coarse) {
  .view-button,
  .quick-amount,
  .segment-remove { min-height: 44px; }
}

@media print {
  .tax-hero .edu-note,
  .premium-zone,
  .unlock-section { display: none !important; }
  .payslip { position: static; box-shadow: none; }
}
