.fee-calculator {
  scroll-margin-top: 6rem;
  margin-bottom: 2rem;
  padding: clamp(1.15rem, 3vw, 2.4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius, 18px);
  background: #fff;
  color: var(--ink);
}
.fee-calculator [hidden] { display: none !important; }
.fee-heading { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.6rem; }
.fee-heading h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.15; }
.fee-heading p { margin: .4rem 0 0; font-size: 1rem; color: var(--muted); }
.fee-icon {
  flex: 0 0 3.25rem; height: 3.25rem; border-radius: .9rem; display: grid;
  place-items: center; background: var(--soft); color: var(--green);
}
.fee-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(1rem, 3.5vw, 3.4rem); }
.fee-controls, .fee-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: .85rem; }
.fee-pair { grid-template-columns: repeat(2, minmax(0,1fr)); }
.fee-calculator label { display: block; font-size: .95rem; font-weight: 650; line-height: 1.5; }
.fee-calculator input, .fee-calculator select {
  display: block; width: 100%; min-height: 2.85rem; margin-top: .35rem; padding: .55rem .8rem;
  border: 1px solid #798e80; border-radius: .5rem; background: white; color: var(--ink);
  font: inherit; font-size: max(1rem, 16px); line-height: 1.45;
}
.fee-calculator select {
  appearance: none; padding-right: 2.2rem; background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'%3E%3Cpath d='m2 2 5 5 5-5' fill='none' stroke='%232d503a' stroke-width='2'/%3E%3C/svg%3E") right .75rem center / .8rem auto no-repeat;
}
.fee-calculator :focus-visible { outline: 3px solid #396c5a; outline-offset: 3px; }
.fee-calculator [aria-invalid="true"] { border-color: #963421; }
.fee-fields { margin-top: 1rem; }
.fee-fields p, .fee-history, .fee-error { margin: .55rem 0 0; font-size: .95rem; line-height: 1.55; color: var(--muted); }
.fee-fields a, .fee-receipt a { text-decoration: underline; text-underline-offset: .18em; }
.fee-error { color: #872d1d; font-weight: 600; }
.fee-error:empty { margin: 0; }
.fee-receipt {
  align-self: stretch; display: flex; flex-direction: column; justify-content: center;
  padding: clamp(1.1rem, 2.4vw, 2rem); background: #174936; color: white; border-radius: .85rem;
}
.fee-receipt > span { font-weight: 650; font-size: .95rem; }
.fee-total { display: grid; gap: .25rem; margin: .5rem 0 1rem; line-height: 1.4; }
.fee-total strong { font-size: clamp(1.7rem, 3.4vw, 3rem); line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: #e6f3b7; }
.fee-total span, .fee-rate { font-size: .95rem; }
.fee-rate { border-top: 1px solid #70907f; padding-top: .65rem; display: flex; flex-wrap: wrap; gap: .2rem 1rem; justify-content: space-between; }
.fee-receipt a { color: #fff; }
.fee-receipt a:focus-visible { outline-color: #e6f3b7; }
@media (max-width: 790px) { .fee-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) {
  .fee-heading { align-items: start; }
  .fee-icon { display: none; }
  .fee-controls, .fee-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (forced-colors: active) { .fee-calculator select { appearance: auto; } .fee-receipt { border: 1px solid CanvasText; } }
