:root {
  --ink: #16211a;
  --ink-deep: #0b1510;
  --ink-muted: #233129;
  --paper: #eef1eb;
  --surface: #ffffff;
  --surface-soft: #f8faf6;
  --line: #dde3d9;
  --line-strong: #bfcabd;
  --muted: #657064;
  --faint: #929d91;
  --brand: #0e6b4f;
  --brand-deep: #0a4c38;
  --brand-soft: #ddf0e5;
  --signal: #dc5a2a;
  --signal-deep: #b0441f;
  --signal-soft: #fae6d9;
  --gold: #e4b957;
  --danger: #b92f25;
  --danger-soft: #fce6e3;
  --shadow-soft: 0 14px 38px rgba(22, 43, 29, 0.07);
  --shadow-lift: 0 26px 58px rgba(11, 27, 19, 0.24);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

svg {
  display: block;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(14, 107, 79, 0.28);
  outline-offset: 2px;
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 0 max(24px, calc((100% - 900px) / 2));
  background: var(--ink-deep);
  color: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.topbar::after {
  content: "";
  position: absolute;
  right: max(24px, calc((100% - 900px) / 2));
  bottom: 0;
  left: max(24px, calc((100% - 900px) / 2));
  height: 1px;
  background: linear-gradient(90deg, var(--gold) 0 28%, rgba(255, 255, 255, 0.14) 28% 100%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--surface);
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--ink-deep);
  font-size: 19px;
  font-weight: 850;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.brand-copy {
  display: block;
  line-height: 1.2;
}

.brand-copy strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
}

.brand-copy small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 700;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 4px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: color 150ms ease;
}

.topbar-link svg {
  width: 18px;
  height: 18px;
}

.topbar-link:hover {
  color: var(--surface);
}

.page-index .topbar,
.page-result .topbar {
  background: var(--surface);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

.page-index .topbar::after,
.page-result .topbar::after {
  height: 2px;
  background: linear-gradient(90deg, var(--brand) 0 28%, var(--line) 28% 100%);
}

.page-index .brand,
.page-result .brand {
  color: var(--ink);
}

.page-index .brand-mark,
.page-result .brand-mark {
  border: 0;
  background: var(--brand);
  color: var(--surface);
}

.page-index .brand-copy small,
.page-result .brand-copy small {
  color: var(--muted);
}

.page-result .topbar-link {
  color: var(--muted);
}

.page-result .topbar-link:hover {
  color: var(--brand-deep);
}

.page-index .topbar-tag {
  border-color: #c9d9ce;
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.page-index .overline span,
.page-result .overline span {
  background: var(--brand);
}

.page-index .region-seal {
  background: var(--brand-deep);
  color: var(--surface);
}

.page-index .choice.is-selected {
  border-color: var(--brand);
  box-shadow: 0 12px 28px rgba(14, 107, 79, 0.13);
}

.page-index .choice.is-selected .choice-code {
  background: var(--brand);
  color: var(--surface);
}

.page-index .segmented-choice.is-selected {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--surface);
  box-shadow: 0 10px 24px rgba(14, 107, 79, 0.16);
}

.stage {
  width: min(100% - 40px, 900px);
  margin: 0 auto;
  padding: 38px 0 72px;
}

.stage-index {
  width: min(100% - 40px, 900px);
}

.stage-result {
  width: min(100% - 40px, 900px);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  padding: 0 0 22px;
  border-bottom: 1px solid var(--line-strong);
}

.sheet-title {
  min-width: 0;
}

.overline {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.overline span {
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--surface);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 38px;
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
}

.page-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.region-readout {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 12px;
  padding-left: 22px;
  border-left: 1px solid var(--line-strong);
}

.region-seal {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--surface);
  font-size: 21px;
  font-weight: 850;
  box-shadow: var(--shadow-soft);
}

.region-readout-copy {
  display: block;
  line-height: 1.2;
}

.region-readout-copy small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.region-readout-copy strong {
  font-size: 19px;
  font-weight: 850;
}

.index-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.26fr) minmax(350px, 0.88fr);
  align-items: start;
  gap: 20px;
}

.worksheet {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.work-section {
  padding: 25px 28px 22px;
}

.work-section + .work-section {
  border-top: 1px solid var(--line);
}

.work-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.work-step {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.work-section-head > div {
  min-width: 0;
}

.work-section-head h2 {
  line-height: 1.15;
}

.work-section-rule {
  display: none;
}

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

.field-block + .field-block {
  margin-top: 24px;
}

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 800;
}

.field-unit {
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.choice {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-width: 0;
  min-height: 118px;
  margin: 0;
  padding: 14px 10px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.choice:not(.is-disabled):hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(22, 43, 29, 0.11);
}

.choice:not(.is-disabled):hover .choice-code {
  background: var(--brand);
  color: var(--surface);
  transform: rotate(-3deg) scale(1.06);
}

.choice:not(.is-disabled):active {
  transform: translateY(-1px) scale(0.995);
  transition-duration: 60ms;
}

.choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice-code {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: #e7ebe4;
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.choice-body {
  display: block;
  min-width: 0;
  padding-right: 22px;
}

.choice-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.choice-name-text {
  font-size: 16px;
  font-weight: 850;
}

.choice-tag {
  padding: 2px 7px;
  border-radius: 999px;
  background: #e9ede6;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
}

.choice-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.choice-marker {
  position: absolute;
  top: 11px;
  right: 11px;
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--signal);
  color: var(--surface);
  font-size: 10px;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 150ms ease, transform 150ms ease;
}

.choice.is-selected {
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(22, 43, 29, 0.1);
}

.choice.is-selected .choice-code {
  background: var(--ink);
  color: var(--surface);
}

.choice.is-selected .choice-tag {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.choice.is-selected .choice-marker {
  opacity: 1;
  transform: scale(1);
}

.choice.is-disabled {
  border-style: dashed;
  background: #f1f3ee;
  cursor: not-allowed;
  transform: none;
}

.choice.is-disabled:hover {
  border-color: var(--line);
  transform: none;
}

.choice.is-disabled input {
  cursor: not-allowed;
}

.choice.is-disabled .choice-code {
  background: #e3e7e0;
  color: #9aa497;
}

.choice.is-disabled .choice-name-text {
  color: var(--muted);
}

.segmented-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.segmented-choice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, color 150ms ease, transform 150ms ease;
}

.segmented-choice:not(.is-selected):hover {
  border-color: var(--brand);
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(22, 43, 29, 0.1);
}

.segmented-choice:not(.is-selected):hover .seg-tax {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.segmented-choice.is-selected:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(22, 43, 29, 0.18);
}

.segmented-choice:active {
  transform: translateY(0) scale(0.99);
  transition-duration: 60ms;
}

.segmented-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.seg-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.seg-title {
  font-size: 15px;
  font-weight: 850;
}

.seg-name {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.seg-tax {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  flex: 0 0 auto;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.segmented-choice.is-selected {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
  box-shadow: 0 10px 24px rgba(22, 43, 29, 0.16);
}

.segmented-choice.is-selected .seg-name {
  color: rgba(255, 255, 255, 0.56);
}

.segmented-choice.is-selected .seg-tax {
  border-color: transparent;
  background: var(--signal);
  color: var(--surface);
}

.money-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

.money-field .field-label {
  margin-bottom: 8px;
}

.money-input {
  position: relative;
}

.money-prefix {
  position: absolute;
  top: 50%;
  left: 15px;
  z-index: 1;
  color: var(--muted);
  font-size: 15px;
  font-weight: 750;
  pointer-events: none;
  transform: translateY(-50%);
}

.money-input input {
  width: 100%;
  height: 52px;
  padding: 0 15px 0 35px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.money-input input::placeholder {
  color: #a6afa1;
  font-weight: 600;
}

.money-input input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(14, 107, 79, 0.14);
}

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

.money-input input.has-error:focus {
  box-shadow: 0 0 0 3px rgba(185, 47, 37, 0.13);
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.inline-error {
  min-height: 18px;
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.submit-wrap {
  padding: 0 28px 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--signal);
  color: var(--surface);
  box-shadow: 0 12px 24px rgba(220, 90, 42, 0.2);
}

.btn-primary:hover {
  background: var(--signal-deep);
  box-shadow: 0 14px 28px rgba(176, 68, 31, 0.24);
}

.btn-ghost {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink-deep);
  box-shadow: var(--shadow-soft);
}

.btn-block {
  width: 100%;
}

.btn-submit {
  min-height: 54px;
  justify-content: space-between;
  padding: 0 20px 0 24px;
}

.btn-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}

.btn.is-busy {
  pointer-events: none;
  opacity: 0.78;
}

.btn.is-busy .btn-icon {
  animation: pulse-icon 900ms ease-in-out infinite;
}

@keyframes pulse-icon {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

.live-slip {
  position: sticky;
  top: 22px;
  min-width: 0;
  overflow: hidden;
  border-top: 3px solid var(--signal);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    var(--ink-deep);
  background-size: 26px 26px;
  color: var(--surface);
  box-shadow: var(--shadow-lift);
}

.slip-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 25px 26px 0;
}

.slip-kicker {
  margin-bottom: 5px;
  color: #9db6a8;
  font-size: 11px;
  font-weight: 800;
}

.slip-head h2 {
  font-size: 23px;
  font-weight: 850;
}

.slip-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.live-slip.is-ready .slip-state {
  border-color: transparent;
  background: #d9f0e2;
  color: var(--brand-deep);
}

.live-slip.is-zero .slip-state {
  border-color: transparent;
  background: #f9ddcc;
  color: var(--signal-deep);
}

.live-slip.is-invalid .slip-state {
  border-color: transparent;
  background: var(--danger-soft);
  color: var(--danger);
}

.slip-rule {
  margin: 17px 26px 0;
  color: #9db6a8;
  font-size: 12px;
  line-height: 1.55;
}

.slip-ledger {
  margin: 6px 0 0;
  padding: 0 26px;
}

.slip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.14);
}

.slip-row span {
  color: #a9bfb2;
  font-size: 12px;
  font-weight: 600;
}

.slip-row strong {
  min-width: 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: 13px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  text-align: right;
}

.slip-total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 18px 26px 0;
  padding: 18px 0 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.slip-total > span {
  flex: 0 0 auto;
  padding-bottom: 5px;
  color: #a9bfb2;
  font-size: 12px;
  font-weight: 700;
}

.slip-total strong {
  min-width: 0;
  color: #f6c76e;
  font-size: 34px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  overflow-wrap: anywhere;
  text-align: right;
}

.slip-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 26px;
  background: rgba(255, 255, 255, 0.045);
  color: #a9bfb2;
  font-size: 11px;
}

.slip-foot strong {
  min-width: 0;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 750;
  overflow-wrap: anywhere;
  text-align: right;
}

.sheet-head-result {
  margin-bottom: 24px;
}

.result-slip {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.payout-strip {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 26px;
  padding: 19px 28px 20px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(220, 90, 42, 0.07) 0 34%, rgba(228, 185, 87, 0.09) 100%),
    var(--surface);
  color: var(--ink);
}

.payout-strip::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--signal) 0 24%, var(--gold) 100%);
}

.payout-main {
  min-width: 0;
}

.payout-kicker {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.payout-main .result-money {
  font-size: 50px;
  color: var(--signal-deep);
  text-align: left;
}

.payout-aside {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding-left: 24px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.payout-aside .result-seal {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--ink-deep);
  font-size: 19px;
  font-weight: 900;
}

.payout-aside-copy {
  display: block;
  min-width: 0;
  line-height: 1.35;
}

.payout-aside-copy strong {
  display: block;
  font-size: 15px;
  font-weight: 850;
}

.payout-aside-copy > span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  font-weight: 600;
}

.process-section + .detail-section {
  border-top: 1px solid var(--line);
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 0 15px;
  border-bottom: 1px solid var(--line);
}

.section-title-row h2 {
  font-size: 18px;
}

.process-section {
  padding: 15px 0 13px;
}

.process-note {
  max-width: 100%;
  padding: 9px 12px 8px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  background: #f6f8f3;
}

.process-note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.process-note-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-deep);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
}

.process-note-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

.process-note .doc-code {
  color: var(--faint);
  font-size: 8px;
  font-weight: 750;
}

.formula-stack {
  display: block;
  padding: 0;
}

.formula-line {
  display: block;
  margin: 0;
  padding: 1px 0;
  color: #647066;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
}

.formula-line + .formula-line {
  margin-top: 1px;
}

.formula-term {
  display: inline;
  min-width: 0;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  vertical-align: baseline;
}

.formula-label {
  display: inline;
  margin-right: 2px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
}

.formula-value {
  display: inline;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.formula-note {
  display: inline;
  margin-left: 3px;
  color: var(--danger);
  font-size: 7.5px;
  font-weight: 750;
  line-height: 1;
  vertical-align: sub;
}

.formula-operator {
  display: inline;
  padding: 0 4px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.formula-term.is-caution .formula-value,
.formula-term.is-final .formula-value {
  color: var(--signal-deep);
}

.detail-key .detail-value {
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.detail-subtle .detail-label {
  color: var(--faint);
  font-size: 11px;
}

.detail-subtle .detail-value {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.detail-final {
  border-bottom: 1px solid var(--line);
}

.detail-final .detail-label {
  font-size: 13px;
  font-weight: 900;
}

.detail-final .detail-value {
  color: var(--signal-deep);
  font-size: 30px;
  font-weight: 950;
  line-height: 1.15;
}

.detail-notice .detail-value {
  color: var(--danger);
  font-weight: 800;
}

.meta-list {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 8px 0 0;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fafbf8;
}

.meta-list .detail-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 2px 0;
  border: 0;
}

.meta-list .detail-row:first-child {
  padding-top: 1px;
}

.meta-list .detail-row:last-child {
  padding-bottom: 1px;
}

.meta-list .detail-label {
  color: #8d978d;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.meta-list .detail-value {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 750;
  text-align: left;
  overflow-wrap: anywhere;
}

.doc-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 30px;
  padding: 30px 34px 36px;
  overflow: hidden;
  background: var(--ink-deep);
  color: var(--surface);
}

.doc-hero::after {
  content: "";
  position: absolute;
  right: 34px;
  bottom: 0;
  left: 34px;
  height: 3px;
  background: linear-gradient(90deg, var(--signal) 0 18%, rgba(255, 255, 255, 0.13) 18% 100%);
}

.doc-identity {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 17px;
  min-width: 0;
}

.result-seal {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--ink-deep);
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.doc-identity-copy {
  display: block;
  min-width: 0;
  line-height: 1.35;
}

.doc-kicker {
  margin-bottom: 4px;
  color: #9db6a8;
  font-size: 12px;
  font-weight: 800;
}

.doc-identity-copy strong {
  display: block;
  font-size: 22px;
  font-weight: 850;
}

.doc-identity-copy > span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 600;
}

.result-money {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  color: #f6c76e;
  font-size: 68px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 0.98;
  overflow-wrap: anywhere;
  text-align: right;
}

.doc-light {
  padding: 0 34px;
}

.doc-light-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 15px;
  border-bottom: 1px solid var(--line);
}

.doc-light-head h2 {
  font-size: 18px;
}

.doc-code {
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.result-ledger {
  display: block;
  margin: 0;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  column-gap: 28px;
  min-width: 0;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.detail-label em {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
}

.detail-value {
  min-width: 0;
  justify-self: end;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  text-align: right;
}

.detail-value .region-cost-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.45;
}

.notice-row .detail-value {
  color: var(--signal-deep);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.btn-action {
  min-width: 214px;
}

.btn-action .btn-icon {
  flex: 0 0 auto;
}

.btn-action > .btn-label + .btn-icon {
  margin-left: 2px;
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 20;
  max-width: calc(100% - 32px);
  padding: 11px 17px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: var(--ink-deep);
  color: var(--surface);
  box-shadow: var(--shadow-lift);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sheet-head,
.worksheet,
.live-slip,
.result-slip,
.result-actions {
  animation: rise-in 460ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.worksheet {
  animation-delay: 40ms;
}

.live-slip {
  animation-delay: 90ms;
}

.result-slip {
  animation-delay: 40ms;
}

.result-actions {
  animation-delay: 110ms;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .index-layout {
    grid-template-columns: 1fr;
  }

  .live-slip {
    position: static;
  }

  .slip-total strong {
    font-size: 34px;
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: 62px;
    padding: 0 18px;
  }

  .topbar::after {
    right: 18px;
    left: 18px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .stage,
  .stage-index,
  .stage-result {
    width: min(100% - 24px, 1180px);
    padding-top: 26px;
    padding-bottom: 48px;
  }

  .sheet-head {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 18px;
  }

  .region-readout {
    align-self: flex-start;
    padding-left: 0;
    border-left: 0;
  }

  .page-meta {
    white-space: normal;
  }

  .work-section {
    padding: 22px 20px 20px;
  }

  .choice-grid,
  .money-grid {
    grid-template-columns: 1fr;
  }

  .choice {
    min-height: 0;
  }

  .submit-wrap {
    padding-right: 20px;
    padding-left: 20px;
  }

  .doc-hero {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 24px;
    padding: 25px 22px 30px;
  }

  .doc-hero::after {
    right: 22px;
    left: 22px;
  }

  .payout-strip {
    display: block;
    padding: 17px 22px 18px;
  }

  .payout-main .result-money {
    font-size: 40px;
  }

  .result-money {
    font-size: 52px;
    text-align: left;
  }

  .doc-light {
    padding: 0 22px;
  }

  .detail-row {
    grid-template-columns: 1fr;
    row-gap: 5px;
  }

  .detail-value {
    justify-self: start;
    text-align: left;
  }

  .meta-list .detail-row {
    grid-template-columns: 1fr;
    row-gap: 2px;
  }

  .meta-list .detail-value {
    justify-self: start;
    text-align: left;
  }

  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .btn-action {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 460px) {
  h1 {
    font-size: 29px;
  }

  .result-money {
    font-size: 44px;
  }

  .payout-main .result-money {
    font-size: 36px;
  }

  .slip-total strong {
    font-size: 30px;
  }

  .topbar-link {
    font-size: 12px;
  }

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

  .doc-identity {
    align-items: flex-start;
    gap: 13px;
  }

  .result-seal {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
    font-size: 24px;
  }

  .doc-code {
    display: none;
  }
}

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