.fee-page {
  --fee-ink: #17160f;
  --fee-muted: #595748;
  --fee-border: #e9dbb9;
  --fee-canvas: #f9f7ef;
  --fee-paper: #fff;
  --fee-cream: #fff8df;
  --fee-yellow: #ffdc00;
  --fee-forest: #194935;
  --fee-mint: #edf5e8;
  --fee-error: #a12a1b;
  background: var(--fee-canvas);
  color: var(--fee-ink);
  padding: 32px 0 64px;
}

.fee-shell {
  display: grid;
  gap: 24px;
}

.fee-page :is(h1, h2, h3, p, dl, dd) { margin: 0; }
.fee-page :is(h1, h2, h3) { text-wrap: balance; }
.fee-page p { text-wrap: pretty; }
.fee-page h2 { font-size: 1.5rem; line-height: 2rem; font-weight: 750; letter-spacing: -.03em; }
.fee-page h3 { font-size: 1.125rem; line-height: 1.75rem; font-weight: 750; }
.fee-page [hidden] { display: none; }
.fee-page :is(input, select, button, a):focus-visible { outline: 3px solid #795a02; outline-offset: 3px; }
.fee-page :is(output, input, .fee-example-values dd) { font-variant-numeric: tabular-nums; }

.fee-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: .875rem;
  line-height: 1.25rem;
  color: var(--fee-muted);
}

.fee-breadcrumb a { color: inherit; }
.fee-breadcrumb [aria-current] { font-weight: 700; color: var(--fee-ink); }

.fee-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, .54fr);
  gap: 32px;
  align-items: center;
  padding: 24px 32px;
  border: 1px solid var(--fee-border);
  border-radius: 24px;
  background: var(--fee-paper);
}

.fee-hero h1 {
  max-width: 40rem;
  font-size: 3rem;
  line-height: 1.12;
  letter-spacing: -.055em;
  font-weight: 780;
}

.fee-hero mark {
  color: inherit;
  background: var(--fee-yellow);
  padding-inline: 8px;
  border-radius: 8px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.fee-hero p {
  max-width: 35rem;
  margin-top: 12px;
  color: var(--fee-muted);
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.fee-cover {
  display: block;
  width: min(100%, 21rem);
  height: auto;
  justify-self: end;
  border-radius: 12px;
}

.fee-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  margin: 0;
}

.fee-panel, .fee-section {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--fee-border);
  border-radius: 24px;
  background: var(--fee-paper);
}

.fee-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.fee-panel > h2 + p, .fee-section :is(h2, h3) + p { color: var(--fee-muted); }
.fee-panel > h2 + p { margin-top: -8px; }

.fee-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 12px;
  align-items: end;
}

.fee-field {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.fee-field label {
  font-weight: 750;
  font-size: .875rem;
  line-height: 1.25rem;
  overflow-wrap: anywhere;
}

.fee-field :is(input, select) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid #c9bea2;
  border-radius: 12px;
  background: #fffefa;
  color: var(--fee-ink);
  font: inherit;
  font-size: 1rem;
}

.fee-field input { font-weight: 700; }
.fee-field :is(input, select)[aria-invalid="true"] { border-color: var(--fee-error); }

.fee-check {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--fee-cream);
  font-size: .875rem;
  line-height: 1.25rem;
  font-weight: 650;
  cursor: pointer;
}

.fee-check input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--fee-forest);
}

.fee-hint, .fee-message {
  color: var(--fee-muted);
  font-size: .875rem;
  line-height: 1.25rem;
}

.fee-message:not(:empty) { padding: 8px 12px; background: var(--fee-cream); border-radius: 8px; }
.fee-message:empty { margin-top: -16px; }
.fee-message[data-error],
.fee-page output[data-negative] { color: var(--fee-error); }

.fee-page button {
  min-height: 44px;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

.fee-page button:disabled { opacity: .55; cursor: default; }
.fee-page button:active:not(:disabled) { transform: translateY(1px); }

.fee-reset {
  justify-self: start;
  padding: 0;
  border: 0;
  color: #604400;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fee-results { background: #fffdf6; }

.fee-total {
  padding: 16px;
  border: 1px solid var(--fee-border);
  border-radius: 16px;
  background: var(--fee-cream);
}

.fee-total h2 { font-size: 1.125rem; line-height: 1.75rem; }

.fee-total output {
  display: block;
  color: var(--fee-forest);
  font-size: 3rem;
  line-height: 1.12;
  letter-spacing: -.055em;
  font-weight: 780;
  overflow-wrap: anywhere;
}

.fee-total p { margin-top: 8px; color: var(--fee-muted); font-size: .875rem; line-height: 1.25rem; }
.fee-breakdown { display: grid; gap: 8px; }

.fee-breakdown > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: 8px;
  align-items: baseline;
}

.fee-breakdown dt { min-width: 0; color: var(--fee-muted); font-size: .875rem; line-height: 1.25rem; }
.fee-breakdown dd { min-width: 0; font-weight: 750; text-align: end; overflow-wrap: anywhere; }

.fee-profit {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--fee-mint);
}

.fee-profit dt, .fee-profit dd { color: var(--fee-forest); font-weight: 750; }

.fee-planner {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--fee-border);
  border-radius: 16px;
  background: var(--fee-paper);
}

.fee-copy {
  justify-self: start;
  padding: 8px 12px;
  border: 1px solid #ebc900;
  border-radius: 12px;
  background: var(--fee-yellow);
  color: var(--fee-ink);
}

.fee-copy:hover:not(:disabled) { background: #f1cf00; }
.fee-reset:hover:not(:disabled) { color: var(--fee-ink); }

.fee-example {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  background: var(--fee-cream);
}

.fee-example p { margin-top: 8px; }
.fee-example-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.fee-example-values > div {
  padding: 12px;
  border-radius: 12px;
  background: var(--fee-paper);
}

.fee-example-values dt { font-size: .875rem; line-height: 1.25rem; color: var(--fee-muted); }
.fee-example-values dd { font-size: 1.25rem; line-height: 1.75rem; font-weight: 750; }

.fee-faq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 16px;
}

.fee-faq article { border-top: 1px solid var(--fee-border); padding-top: 12px; }
.fee-faq p { margin-top: 4px; }
.fee-related > div { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 8px; }
.fee-related a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: #604400; font-weight: 750; }
.fee-notice { padding: 12px 16px; border-radius: 12px; background: var(--fee-cream); color: var(--fee-muted); }

@media (max-width: 56rem) {
  .fee-hero { gap: 16px; padding: 24px; }
  .fee-hero h1 { font-size: 2.25rem; line-height: 2.5rem; }
  .fee-workbench, .fee-example { grid-template-columns: 1fr; }
}

@media (max-width: 37.5rem) {
  .fee-page { padding: 24px 0 48px; }
  .fee-shell { gap: 16px; }
  .fee-hero, .fee-panel, .fee-section { padding: 16px; border-radius: 16px; }
  .fee-hero { grid-template-columns: 1fr; }
  .fee-hero h1 { font-size: 1.875rem; line-height: 2.25rem; }
  .fee-hero p { font-size: 1rem; line-height: 1.5rem; }
  .fee-cover { display: none; }
  .fee-faq { grid-template-columns: 1fr; gap: 16px; }
  .fee-total output { font-size: 2.25rem; line-height: 2.5rem; }
  .fee-field :is(input, select) { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .fee-page button:active:not(:disabled) { transform: none; }
}
