:root {
  color-scheme: light;
  --ink: #172038;
  --muted: #667085;
  --soft-muted: #98a2b3;
  --line: #e5e8f1;
  --surface: #ffffff;
  --canvas: #f6f7fb;
  --primary: #4967dc;
  --primary-dark: #354fbd;
  --primary-soft: #eef1ff;
  --teal: #14978d;
  --teal-soft: #e9f8f5;
  --warning: #a66c00;
  --warning-soft: #fff7e6;
  --danger: #d14343;
  --danger-soft: #fff0f0;
  --shadow-sm: 0 8px 24px rgba(32, 42, 82, 0.06);
  --shadow-lg: 0 24px 70px rgba(31, 42, 82, 0.15);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 6%, rgba(73, 103, 220, 0.1), transparent 24rem),
    radial-gradient(circle at 92% 35%, rgba(20, 151, 141, 0.07), transparent 25rem),
    var(--canvas);
}

body:has(dialog[open]) {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(73, 103, 220, 0.22);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.offline-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 7px 16px;
  color: #fff;
  background: #344054;
  font-size: 13px;
  text-align: center;
}

.app-header {
  border-bottom: 1px solid rgba(225, 229, 239, 0.9);
  background: rgba(249, 250, 253, 0.82);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1120px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: linear-gradient(145deg, #5c78eb, #3954c2);
  box-shadow: 0 8px 20px rgba(73, 103, 220, 0.24);
  font-size: 21px;
  font-weight: 700;
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand strong {
  font-size: 16px;
  letter-spacing: 0.02em;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.text-button,
.danger-text-button {
  border: 0;
  padding: 8px;
  background: none;
  cursor: pointer;
  font-weight: 600;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #4c5870;
}

.text-button:hover {
  color: var(--primary);
}

.info-icon {
  display: inline-grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 12px;
}

.page-shell {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: 58px 0 40px;
}

.intro {
  max-width: 660px;
  margin: 0 auto 46px;
  text-align: center;
}

.eyebrow,
.section-kicker {
  margin: 0 0 9px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro h1 {
  margin: 0;
  font-size: clamp(35px, 5.1vw, 56px);
  line-height: 1.13;
  letter-spacing: -0.045em;
}

.intro > p:last-child {
  max-width: 590px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.mobile-break {
  display: none;
}

.stepper {
  width: min(760px, 100%);
  margin: 0 auto 26px;
  display: grid;
  grid-template-columns: minmax(125px, 1fr) minmax(40px, 0.7fr) minmax(125px, 1fr) minmax(40px, 0.7fr) minmax(125px, 1fr);
  align-items: center;
}

.step-item {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  cursor: pointer;
}

.step-item:disabled {
  cursor: default;
}

.step-dot {
  flex: 0 0 auto;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #d9deeb;
  border-radius: 50%;
  color: #8b94a7;
  background: #fff;
  box-shadow: 0 3px 10px rgba(28, 39, 78, 0.04);
  font-size: 13px;
  font-weight: 750;
}

.step-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.step-copy strong {
  color: #7a8396;
  font-size: 13px;
  white-space: nowrap;
}

.step-copy small {
  margin-top: 3px;
  color: #a0a7b5;
  font-size: 10px;
  white-space: nowrap;
}

.step-item.is-active .step-dot {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 20px rgba(73, 103, 220, 0.24);
}

.step-item.is-complete .step-dot {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.step-item.is-complete .step-dot span {
  font-size: 0;
}

.step-item.is-complete .step-dot span::after {
  content: "✓";
  font-size: 15px;
}

.step-item.is-active .step-copy strong,
.step-item.is-complete .step-copy strong {
  color: var(--ink);
}

.step-line {
  height: 1px;
  margin: 0 15px;
  background: #dfe3ec;
}

.step-line.is-complete {
  background: var(--primary);
}

.storage-notice {
  max-width: 840px;
  margin: 0 auto 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #f2d194;
  border-radius: var(--radius-sm);
  color: #835d18;
  background: var(--warning-soft);
  font-size: 13px;
}

.storage-notice > span,
.policy-note > span {
  flex: 0 0 auto;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.storage-notice p,
.policy-note p {
  margin: 0;
}

.step-panel {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 46px 36px;
  overflow: hidden;
  border: 1px solid rgba(224, 228, 238, 0.9);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-sm);
}

.result-panel {
  max-width: 1040px;
}

.panel-heading,
.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}

.panel-heading h2,
.result-heading h2,
.modal-header h2,
.drawer-header h2 {
  margin: 0;
  font-size: 27px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.panel-heading p:last-child,
.result-heading p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.privacy-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 999px;
  color: #147c73;
  background: var(--teal-soft);
  font-size: 11px;
  font-weight: 700;
}

.privacy-chip span {
  font-size: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px 22px;
}

.field-group {
  min-width: 0;
}

.field-group > label {
  display: block;
  margin-bottom: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.field-group > label span {
  color: var(--danger);
}

.field-primary {
  grid-column: 1 / -1;
}

.field-primary .input-shell {
  max-width: calc(50% - 11px);
}

.contribution-method-section {
  grid-column: 1 / -1;
  min-width: 0;
}

.method-selector {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.method-selector legend {
  margin-bottom: 9px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.method-selector legend span {
  color: var(--danger);
}

.method-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.method-card {
  position: relative;
  min-width: 0;
  min-height: 78px;
  padding: 15px 15px 15px 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d8dde8;
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.method-card:hover {
  border-color: #aebbee;
}

.method-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(73, 103, 220, 0.08);
}

.method-card:has(input:focus-visible) {
  outline: 3px solid rgba(73, 103, 220, 0.22);
  outline-offset: 2px;
}

.method-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.method-radio {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  border: 1.5px solid #aab2c2;
  border-radius: 50%;
  background: #fff;
}

.method-card:has(input:checked) .method-radio {
  border: 5px solid var(--primary);
}

.method-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.method-copy strong {
  color: #2f3a52;
  font-size: 13px;
}

.method-copy small {
  color: #7f889a;
  font-size: 11px;
  line-height: 1.45;
}

.method-badge {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 4px 7px;
  border-radius: 999px;
  color: #147c73;
  background: var(--teal-soft);
  font-size: 10px;
  font-weight: 700;
}

.base-entry-layout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 18px;
}

.base-method-panel {
  min-width: 0;
}

.input-shell {
  position: relative;
  min-height: 50px;
  display: flex;
  align-items: center;
  border: 1px solid #d8dde8;
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-shell:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(73, 103, 220, 0.1);
}

.input-shell input {
  width: 100%;
  min-width: 0;
  padding: 13px 12px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.input-shell input::placeholder {
  color: #b0b6c2;
}

.input-prefix {
  padding-left: 14px;
  color: #858da0;
  font-size: 14px;
}

.input-suffix {
  flex: 0 0 auto;
  padding-right: 14px;
  color: #858da0;
  font-size: 12px;
}

.field-help,
.field-error {
  min-height: 18px;
  margin: 7px 2px 0;
  font-size: 11px;
  line-height: 1.55;
}

.field-help {
  color: #838b9d;
}

.field-error {
  display: none;
  color: var(--danger);
}

.field-group.has-error .input-shell {
  border-color: var(--danger);
  background: #fffafa;
}

.field-group.has-error .field-help {
  display: none;
}

.field-group.has-error .field-error {
  display: block;
}

.base-preview {
  min-height: 92px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid #dce3ff;
  border-radius: var(--radius-md);
  background: linear-gradient(120deg, #f5f7ff, #fbfcff);
}

.preview-icon {
  flex: 0 0 auto;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  color: var(--primary);
  background: #e5eaff;
  font-size: 12px;
  font-weight: 800;
}

.base-preview > div:last-child {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 3px 16px;
}

.base-preview span {
  color: #64708a;
  font-size: 12px;
  font-weight: 650;
}

.base-preview strong {
  grid-column: 1;
  margin-top: 3px;
  color: var(--primary-dark);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.base-preview p {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  color: #858da0;
  font-size: 11px;
}

.policy-note,
.result-risk-note {
  margin-top: 24px;
  padding: 13px 15px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #f0dfb9;
  border-radius: var(--radius-sm);
  color: #84611f;
  background: #fffbf1;
  font-size: 12px;
  line-height: 1.6;
}

.policy-note strong {
  display: block;
  color: #694c15;
}

.panel-actions {
  margin-top: 34px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.split-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.danger-text-button {
  color: #8d5d5d;
  font-size: 12px;
}

.danger-text-button:hover {
  color: var(--danger);
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 48px;
  padding: 0 21px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.primary-button {
  border: 1px solid var(--primary);
  color: #fff;
  background: var(--primary);
  box-shadow: 0 9px 22px rgba(73, 103, 220, 0.2);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--primary-dark);
  box-shadow: 0 12px 25px rgba(73, 103, 220, 0.25);
}

.primary-button:disabled {
  border-color: #d8dce6;
  color: #9fa6b5;
  background: #edf0f4;
  box-shadow: none;
}

.secondary-button {
  border: 1px solid #d8dde8;
  color: #4b566d;
  background: #fff;
}

.secondary-button:hover {
  border-color: #bfc7d9;
  background: #fafbfc;
}

.danger-button {
  border: 1px solid var(--danger);
  color: #fff;
  background: var(--danger);
}

.base-pill {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid #dce3ff;
  border-radius: 12px;
  background: #f7f8ff;
  text-align: right;
}

.base-pill span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.base-pill strong {
  display: block;
  margin-top: 3px;
  color: var(--primary-dark);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.deduction-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 28px;
}

.subsection-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 18px;
}

.subsection-heading h3,
.table-heading h3 {
  margin: 0;
  font-size: 16px;
}

.subsection-heading p,
.table-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.suggestion-label {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 7px;
  color: #6072bd;
  background: var(--primary-soft);
  font-size: 9px;
  font-weight: 700;
}

.rate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 16px;
}

.compact-field {
  position: relative;
}

.compact-field .input-shell {
  min-height: 46px;
}

.compact-field .input-shell input {
  padding-right: 4px;
}

.compact-field .live-amount {
  display: block;
  min-height: 16px;
  margin-top: 5px;
  color: #6d7689;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.compact-field .field-error {
  min-height: 16px;
  margin-top: 5px;
  font-size: 10px;
}

.compact-field.has-error .live-amount {
  display: none;
}

.special-deduction-block {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.deduction-help {
  margin-top: 9px;
  color: #687386;
  font-size: 11px;
}

.deduction-help summary,
.calculation-basis summary {
  width: fit-content;
  color: var(--primary);
  cursor: pointer;
  font-weight: 650;
}

.deduction-help p {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: #f7f8fb;
  line-height: 1.65;
}

.deduction-summary {
  align-self: start;
  padding: 24px 22px;
  border-radius: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.15), transparent 11rem),
    linear-gradient(150deg, #2f477d, #21335f);
  box-shadow: 0 15px 35px rgba(35, 52, 97, 0.2);
}

.summary-eyebrow {
  margin: 0;
  color: #b8c8ee;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.summary-total {
  display: block;
  margin-top: 10px;
  font-size: 27px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.summary-caption {
  margin: 4px 0 20px;
  color: #aebcdc;
  font-size: 10px;
}

.deduction-summary dl {
  margin: 0;
}

.deduction-summary dl > div {
  padding: 6px 0;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 11px;
}

.deduction-summary dt {
  color: #bdc9e5;
}

.deduction-summary dd {
  margin: 0;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.summary-divider {
  height: 1px;
  margin: 17px 0;
  background: rgba(255, 255, 255, 0.16);
}

.tax-deduction-total {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 11px;
}

.tax-deduction-total strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.tax-deduction-total small {
  grid-column: 1 / -1;
  color: #9faed0;
  font-size: 9px;
}

.result-heading {
  margin-bottom: 18px;
}

.result-heading > div:first-child {
  min-width: 0;
  flex: 1;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-button {
  min-height: 38px;
  padding: 0 14px;
  font-size: 11px;
  white-space: nowrap;
}

.icon-button,
.dialog-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #e0e4ec;
  border-radius: 11px;
  color: #747d8e;
  background: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover,
.dialog-close:hover {
  color: var(--ink);
  background: #f7f8fa;
}

.result-risk-note {
  margin: 0 0 22px;
  border-color: #dce3ff;
  color: #586889;
  background: #f7f8ff;
}

.result-risk-note > span {
  flex: 0 0 auto;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid #7990d9;
  border-radius: 50%;
  color: #5670c2;
  font-family: Georgia, serif;
  font-size: 11px;
}

.result-risk-note p {
  margin: 0;
}

.annual-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.annual-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid #e5e8ef;
  border-radius: 15px;
  background: #fbfcfe;
}

.annual-card.is-highlight {
  border-color: #d9e1ff;
  background: linear-gradient(145deg, #eef2ff, #f8f9ff);
}

.annual-card span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.annual-card strong {
  display: block;
  margin-top: 10px;
  overflow: hidden;
  color: #26324a;
  font-size: clamp(16px, 2vw, 22px);
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.annual-card.is-highlight strong {
  color: var(--primary-dark);
}

.annual-card small {
  display: block;
  margin-top: 6px;
  color: #9aa2b2;
  font-size: 9px;
}

.result-breakdown {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.table-heading {
  margin-bottom: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7c8494;
  font-size: 9px;
}

.legend span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #eaa333;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid #e6e9f0;
  border-radius: 15px;
}

.monthly-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.monthly-table th,
.monthly-table td {
  padding: 13px 12px;
  border-bottom: 1px solid #eceef3;
  text-align: right;
  white-space: nowrap;
}

.monthly-table th {
  color: #7b8497;
  background: #f8f9fb;
  font-size: 9px;
  font-weight: 700;
}

.monthly-table th:first-child,
.monthly-table td:first-child {
  padding-left: 16px;
  text-align: left;
}

.monthly-table th:last-child,
.monthly-table td:last-child {
  width: 32px;
  padding-right: 13px;
}

.monthly-table tbody tr:last-child td {
  border-bottom: 0;
}

.monthly-table tbody tr {
  cursor: pointer;
  transition: background 140ms ease;
}

.monthly-table tbody tr:hover {
  background: #f8f9ff;
}

.monthly-table tbody tr.has-bracket-change {
  background: #fffaf1;
}

.monthly-table tbody tr.has-bracket-change:hover {
  background: #fff7e7;
}

.monthly-table tbody tr.has-negative-pay {
  background: var(--danger-soft);
}

.month-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.bracket-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #eaa333;
}

.bracket-badge,
.negative-badge {
  display: block;
  width: fit-content;
  margin-top: 3px;
  padding: 2px 5px;
  border-radius: 5px;
  color: #94600d;
  background: #ffedc9;
  font-size: 7px;
  font-weight: 700;
}

.negative-badge {
  color: #9f3030;
  background: #ffdede;
}

.net-pay {
  color: var(--primary-dark);
  font-weight: 750;
}

.row-arrow {
  color: #9ca4b4;
  font-size: 15px;
}

.calculation-basis {
  margin-top: 18px;
  padding: 15px 17px;
  border: 1px solid #e6e9f0;
  border-radius: 13px;
  background: #fafbfc;
  color: #697386;
  font-size: 11px;
}

.calculation-basis summary {
  color: #5c6780;
}

.basis-grid {
  margin-top: 13px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.basis-grid > div {
  padding: 10px;
  border-radius: 9px;
  background: #fff;
}

.basis-grid span,
.basis-grid strong {
  display: block;
}

.basis-grid span {
  color: #8a92a2;
  font-size: 9px;
}

.basis-grid strong {
  margin-top: 5px;
  color: #424d64;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.stale-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  min-height: 520px;
  padding: 30px;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: rgba(246, 248, 252, 0.86);
  backdrop-filter: blur(5px);
}

.stale-card {
  max-width: 390px;
  padding: 30px;
  border: 1px solid #e1e5ee;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.stale-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 15px;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 24px;
}

.stale-card h3 {
  margin: 0;
  font-size: 18px;
}

.stale-card p {
  margin: 9px 0 21px;
  color: var(--muted);
  font-size: 12px;
}

.footer-note {
  margin: 22px 0 0;
  color: #9aa2b1;
  font-size: 10px;
  text-align: center;
}

.modal,
.drawer {
  color: var(--ink);
  border: 0;
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.modal::backdrop,
.drawer::backdrop {
  background: rgba(20, 27, 48, 0.42);
  backdrop-filter: blur(3px);
}

.modal {
  width: min(590px, calc(100% - 32px));
  max-height: min(760px, calc(100vh - 50px));
  padding: 0;
  overflow: auto;
  border-radius: 22px;
}

.modal-header,
.drawer-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 24px 26px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #e8eaf0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
}

.modal-body {
  padding: 24px 26px 27px;
}

.guide-content > section {
  padding: 17px 0;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 15px;
  border-bottom: 1px solid #eceef3;
}

.guide-content > section:first-child {
  padding-top: 0;
}

.guide-number {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 800;
}

.guide-content h3 {
  margin: 0;
  font-size: 14px;
}

.guide-content p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.guide-boundary {
  margin-top: 21px;
  padding: 17px;
  border-radius: 13px;
  background: #f7f8fb;
}

.guide-boundary p {
  margin-bottom: 0;
}

.policy-version {
  display: block;
  margin-top: 10px;
  color: #9299a8;
  font-size: 10px;
}

.guide-content .disclaimer {
  margin-top: 16px;
  color: #9299a8;
  font-size: 10px;
  text-align: center;
}

.confirm-modal {
  width: min(410px, calc(100% - 32px));
  padding: 30px;
  text-align: center;
}

.confirm-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 17px;
  place-items: center;
  border-radius: 50%;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 19px;
  font-weight: 800;
}

.confirm-modal h2 {
  margin: 0;
  font-size: 20px;
}

.confirm-modal > p {
  margin: 11px 0 24px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.drawer {
  width: min(720px, 100%);
  max-width: 100%;
  max-height: min(750px, 88vh);
  margin: auto auto 0;
  padding: 0;
  overflow: auto;
  border-radius: 24px 24px 0 0;
}

.drawer-handle {
  position: sticky;
  top: 7px;
  z-index: 4;
  width: 44px;
  height: 4px;
  margin: 7px auto -8px;
  border-radius: 99px;
  background: #d8dce5;
}

.drawer-header {
  padding-top: 22px;
}

.drawer-body {
  padding: 22px 26px calc(30px + env(safe-area-inset-bottom));
}

.drawer-pay-summary {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, #435fac, #293f7a);
}

.drawer-pay-summary div {
  min-width: 0;
}

.drawer-pay-summary span,
.drawer-pay-summary strong {
  display: block;
}

.drawer-pay-summary span {
  color: #c8d3f0;
  font-size: 9px;
}

.drawer-pay-summary strong {
  margin-top: 7px;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.drawer-section {
  margin-top: 22px;
}

.drawer-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
}

.detail-list {
  margin: 0;
  border: 1px solid #e7e9ef;
  border-radius: 13px;
  overflow: hidden;
}

.detail-list > div {
  padding: 11px 13px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #eceef3;
  font-size: 11px;
}

.detail-list > div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
  color: #38445b;
  font-weight: 650;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.formula-card {
  padding: 14px;
  border-radius: 12px;
  color: #59657d;
  background: #f6f7fb;
  font-size: 11px;
  line-height: 1.75;
}

.formula-card strong {
  color: #344054;
}

.drawer-warning {
  margin-top: 16px;
  padding: 11px 13px;
  border-radius: 10px;
  color: #9c3e3e;
  background: var(--danger-soft);
  font-size: 11px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 100;
  max-width: calc(100% - 40px);
  padding: 11px 16px;
  transform: translateX(-50%);
  border-radius: 10px;
  color: #fff;
  background: rgba(29, 38, 61, 0.94);
  box-shadow: 0 10px 30px rgba(20, 27, 48, 0.25);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 28px, 740px);
  }

  .step-panel {
    padding: 32px 28px;
  }

  .step-copy small {
    display: none;
  }

  .deduction-layout {
    grid-template-columns: 1fr;
  }

  .deduction-summary {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 0 28px;
  }

  .deduction-summary dl {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .summary-divider,
  .tax-deduction-total {
    grid-column: 1 / -1;
  }

  .annual-summary {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .header-inner {
    width: calc(100% - 28px);
    min-height: 64px;
  }

  .page-shell {
    width: calc(100% - 24px);
    padding-top: 39px;
  }

  .intro {
    margin-bottom: 34px;
  }

  .intro h1 {
    font-size: 37px;
  }

  .mobile-break {
    display: initial;
  }

  .intro > p:last-child {
    font-size: 14px;
  }

  .stepper {
    grid-template-columns: 1fr 32px 1fr 32px 1fr;
    margin-bottom: 20px;
  }

  .step-item {
    flex-direction: column;
    gap: 7px;
    text-align: center;
  }

  .step-dot {
    width: 32px;
    height: 32px;
    font-size: 11px;
  }

  .step-copy strong {
    font-size: 10px;
  }

  .step-line {
    margin: -19px 4px 0;
  }

  .step-panel {
    padding: 25px 20px 22px;
    border-radius: 19px;
  }

  .panel-heading,
  .result-heading {
    margin-bottom: 25px;
  }

  .panel-heading h2,
  .result-heading h2,
  .modal-header h2,
  .drawer-header h2 {
    font-size: 22px;
  }

  .privacy-chip {
    display: none;
  }

  .form-grid,
  .rate-grid {
    grid-template-columns: 1fr;
  }

  .method-options,
  .base-entry-layout {
    grid-template-columns: 1fr;
  }

  .method-card {
    min-height: 72px;
  }

  .field-primary .input-shell {
    max-width: none;
  }

  .base-preview {
    align-items: flex-start;
  }

  .base-preview > div:last-child {
    grid-template-columns: 1fr;
  }

  .base-preview strong,
  .base-preview p {
    grid-column: 1;
  }

  .base-preview p {
    grid-row: auto;
  }

  .split-actions {
    flex-wrap: wrap;
  }

  .split-actions .primary-button {
    flex: 1 1 100%;
    order: -1;
  }

  .split-actions .secondary-button {
    flex: 1 1 100%;
  }

  .split-actions .danger-text-button {
    width: 100%;
    margin-top: 3px;
  }

  .base-pill {
    display: none;
  }

  .deduction-summary {
    display: block;
  }

  .deduction-summary dl {
    margin-top: 17px;
  }

  .annual-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .annual-card {
    padding: 13px 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 3px 14px;
  }

  .annual-card strong {
    margin-top: 0;
    overflow: visible;
    font-size: 16px;
    text-overflow: clip;
  }

  .annual-card small {
    grid-column: 1 / -1;
    margin-top: 1px;
  }

  .legend {
    display: none;
  }

  .table-scroll {
    overflow: visible;
    border: 0;
  }

  .monthly-table,
  .monthly-table tbody {
    display: block;
  }

  .monthly-table thead {
    display: none;
  }

  .monthly-table tbody {
    display: grid;
    gap: 9px;
  }

  .monthly-table tbody tr {
    position: relative;
    padding: 14px 37px 14px 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
    border: 1px solid #e5e8ef;
    border-radius: 13px;
    background: #fff;
  }

  .monthly-table th,
  .monthly-table td,
  .monthly-table th:first-child,
  .monthly-table td:first-child,
  .monthly-table th:last-child,
  .monthly-table td:last-child {
    width: auto;
    padding: 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }

  .monthly-table td:first-child {
    grid-column: 1 / -1;
    padding-bottom: 9px;
    border-bottom: 1px solid #eceef3;
  }

  .monthly-table td:not(:first-child, :last-child)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: #8c94a5;
    font-size: 8px;
  }

  .monthly-table td:last-child {
    position: absolute;
    top: 16px;
    right: 14px;
  }

  .basis-grid {
    grid-template-columns: 1fr 1fr;
  }

  .modal-header,
  .drawer-header {
    padding-right: 20px;
    padding-left: 20px;
  }

  .modal-body,
  .drawer-body {
    padding-right: 20px;
    padding-left: 20px;
  }

  .drawer-pay-summary {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
