.btp-ethereum-gas-calculator {
  --eth-gas-ink: #10243a;
  --eth-gas-muted: #5f7186;
  --eth-gas-line: #d8e0e8;
  --eth-gas-soft: #f5f8fb;
  --eth-gas-accent: #2563eb;
  --eth-gas-good: #16794d;
  width: min(100%, 960px);
  margin-inline: auto;
  color: var(--eth-gas-ink);
}

.btp-ethereum-gas-calculator *,
.btp-ethereum-gas-calculator *::before,
.btp-ethereum-gas-calculator *::after {
  box-sizing: border-box;
}

.btp-ethereum-gas-calculator button,
.btp-ethereum-gas-calculator input,
.btp-ethereum-gas-calculator select {
  font: inherit;
}

.btp-ethereum-gas-calculator__mode {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--eth-gas-line);
  border-radius: 8px;
  background: var(--eth-gas-soft);
}

.btp-ethereum-gas-calculator__mode button {
  min-height: 42px;
  padding: 8px 18px;
  border: 0;
  border-radius: 6px;
  color: var(--eth-gas-muted);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.btp-ethereum-gas-calculator__mode button.is-active {
  color: var(--eth-gas-ink);
  background: #fff;
  box-shadow: 0 2px 10px rgb(15 23 42 / 8%);
}

.btp-ethereum-gas-calculator__workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(310px, .92fr);
  gap: 20px;
  align-items: start;
}

.btp-ethereum-gas-calculator__inputs,
.btp-ethereum-gas-calculator__result,
.btp-ethereum-gas-calculator__comparison {
  border: 1px solid var(--eth-gas-line);
  border-radius: 8px;
  background: #fff;
}

.btp-ethereum-gas-calculator__inputs {
  padding: clamp(20px, 3vw, 30px);
  box-shadow: 0 18px 45px rgb(15 23 42 / 7%);
}

.btp-ethereum-gas-calculator__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.btp-ethereum-gas-calculator__field {
  min-width: 0;
  margin-bottom: 18px;
}

.btp-ethereum-gas-calculator__field label {
  display: block;
  margin-bottom: 7px;
  color: var(--eth-gas-ink);
  font-size: .92rem;
  font-weight: 750;
}

.btp-ethereum-gas-calculator__field input,
.btp-ethereum-gas-calculator__field select {
  width: 100%;
  min-height: 50px;
  border: 1px solid #bfcbd8;
  border-radius: 7px;
  padding: 11px 13px;
  color: var(--eth-gas-ink);
  background: #fff;
}

.btp-ethereum-gas-calculator__field input:focus,
.btp-ethereum-gas-calculator__field select:focus,
.btp-ethereum-gas-calculator button:focus-visible {
  outline: 3px solid rgb(37 99 235 / 24%);
  outline-offset: 2px;
  border-color: var(--eth-gas-accent);
}

.btp-ethereum-gas-calculator__field small,
.btp-ethereum-gas-calculator__help {
  display: block;
  margin-top: 7px;
  color: var(--eth-gas-muted);
  font-size: .82rem;
  line-height: 1.55;
}

.btp-ethereum-gas-calculator__suffix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.btp-ethereum-gas-calculator__suffix input {
  border-radius: 7px 0 0 7px;
}

.btp-ethereum-gas-calculator__suffix span {
  display: grid;
  min-width: 64px;
  place-items: center;
  border: 1px solid #bfcbd8;
  border-left: 0;
  border-radius: 0 7px 7px 0;
  color: #42556c;
  background: var(--eth-gas-soft);
  font-weight: 700;
}

.btp-ethereum-gas-calculator__actions,
.btp-ethereum-gas-calculator__result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.btp-ethereum-gas-calculator__actions button,
.btp-ethereum-gas-calculator__actions a,
.btp-ethereum-gas-calculator__result-actions button,
.btp-ethereum-gas-calculator__trace > button {
  min-height: 44px;
  border: 1px solid var(--eth-gas-line);
  border-radius: 7px;
  padding: 10px 16px;
  color: var(--eth-gas-ink);
  background: #fff;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
}

.btp-ethereum-gas-calculator__actions .btp-button {
  border-color: var(--eth-gas-accent);
  color: #fff;
  background: var(--eth-gas-accent);
}

.btp-ethereum-gas-calculator__error {
  margin: 14px 0 0;
  padding: 11px 13px;
  border-left: 4px solid #dc2626;
  color: #9f1239;
  background: #fff1f2;
  font-size: .9rem;
}

.btp-ethereum-gas-calculator__result {
  position: sticky;
  top: 96px;
  overflow: clip;
  padding: clamp(20px, 3vw, 28px);
  background: linear-gradient(180deg, #f7faff 0%, #fff 62%);
  box-shadow: 0 18px 45px rgb(15 23 42 / 7%);
}

.btp-ethereum-gas-calculator__status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #3d4f63;
  background: #e8eef5;
  font-size: .75rem;
  font-weight: 800;
}

.btp-ethereum-gas-calculator__status.is-fresh,
.btp-ethereum-gas-calculator__status.is-live {
  color: #12613f;
  background: #dcfce7;
}

.btp-ethereum-gas-calculator__status.is-delayed,
.btp-ethereum-gas-calculator__status.is-cached {
  color: #8a4b08;
  background: #fff3d6;
}

.btp-ethereum-gas-calculator__result-label {
  margin: 24px 0 5px;
  color: var(--eth-gas-muted);
  font-size: .85rem;
  font-weight: 750;
}

.btp-ethereum-gas-calculator__result-main {
  display: block;
  overflow-wrap: anywhere;
  color: var(--eth-gas-ink);
  font-size: clamp(1.7rem, 4vw, 2.45rem);
  line-height: 1.12;
}

.btp-ethereum-gas-calculator__usd {
  margin: 8px 0 20px;
  color: var(--eth-gas-muted);
}

.btp-ethereum-gas-calculator__cap {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--eth-gas-line);
  border-radius: 7px;
  background: #fff;
}

.btp-ethereum-gas-calculator__cap span,
.btp-ethereum-gas-calculator__cap small,
.btp-ethereum-gas-calculator__metrics span {
  color: var(--eth-gas-muted);
  font-size: .78rem;
}

.btp-ethereum-gas-calculator__cap strong {
  overflow-wrap: anywhere;
  font-size: 1.16rem;
}

.btp-ethereum-gas-calculator__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid var(--eth-gas-line);
  border-radius: 7px;
  background: var(--eth-gas-line);
}

.btp-ethereum-gas-calculator__metrics div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 13px;
  background: #fff;
}

.btp-ethereum-gas-calculator__metrics strong {
  overflow-wrap: anywhere;
  font-size: .9rem;
}

.btp-ethereum-gas-calculator__constraint {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 6px;
  color: #8a4b08;
  background: #fff7e6;
  font-size: .85rem;
}

.btp-ethereum-gas-calculator__trace {
  padding-block: 4px 12px;
  border-bottom: 1px solid var(--eth-gas-line);
}

.btp-ethereum-gas-calculator__trace > button {
  width: 100%;
  text-align: left;
}

.btp-ethereum-gas-calculator__trace code {
  display: block;
  margin-top: 12px;
  padding: 12px;
  overflow-wrap: anywhere;
  white-space: normal;
  color: #21364c;
  background: var(--eth-gas-soft);
  line-height: 1.55;
}

.btp-ethereum-gas-calculator__trace dl {
  margin: 12px 0;
}

.btp-ethereum-gas-calculator__trace dl div {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #edf1f5;
  font-size: .8rem;
}

.btp-ethereum-gas-calculator__trace dt {
  color: var(--eth-gas-muted);
}

.btp-ethereum-gas-calculator__trace dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.btp-ethereum-gas-calculator__copy-status {
  min-height: 22px;
  margin: 8px 0 0;
  color: var(--eth-gas-good);
  font-size: .8rem;
}

.btp-ethereum-gas-calculator__noscript {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--eth-gas-line);
  border-radius: 7px;
  color: var(--eth-gas-muted);
  background: var(--eth-gas-soft);
  line-height: 1.55;
}

.btp-ethereum-gas-calculator__noscript a {
  color: var(--eth-gas-accent);
  font-weight: 700;
}

.btp-ethereum-gas-calculator__comparison {
  display: grid;
  grid-template-columns: minmax(210px, .72fr) minmax(0, 1.28fr);
  gap: 24px;
  margin-top: 20px;
  padding: clamp(20px, 3vw, 28px);
}

.btp-ethereum-gas-calculator__comparison h3 {
  margin: 5px 0 8px;
  font-size: 1.25rem;
}

.btp-ethereum-gas-calculator__comparison p,
.btp-ethereum-gas-calculator__comparison > div > span {
  margin: 0;
  color: var(--eth-gas-muted);
  font-size: .84rem;
  line-height: 1.55;
}

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

.btp-ethereum-gas-calculator__comparison-grid button {
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 96px;
  padding: 13px;
  border: 1px solid var(--eth-gas-line);
  border-radius: 7px;
  color: var(--eth-gas-ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.btp-ethereum-gas-calculator__comparison-grid button.is-selected {
  border-color: var(--eth-gas-accent);
  box-shadow: inset 0 0 0 1px var(--eth-gas-accent);
}

.btp-ethereum-gas-calculator__comparison-grid small {
  overflow-wrap: anywhere;
  color: var(--eth-gas-muted);
}

.btp-ethereum-gas-calculator [hidden] {
  display: none !important;
}

html[data-theme="dark"] .btp-ethereum-gas-calculator {
  --eth-gas-ink: #edf4fb;
  --eth-gas-muted: #a8b7c8;
  --eth-gas-line: #33465b;
  --eth-gas-soft: #17283a;
}

html[data-theme="dark"] .btp-ethereum-gas-calculator__inputs,
html[data-theme="dark"] .btp-ethereum-gas-calculator__result,
html[data-theme="dark"] .btp-ethereum-gas-calculator__comparison,
html[data-theme="dark"] .btp-ethereum-gas-calculator__field input,
html[data-theme="dark"] .btp-ethereum-gas-calculator__field select,
html[data-theme="dark"] .btp-ethereum-gas-calculator__cap,
html[data-theme="dark"] .btp-ethereum-gas-calculator__metrics div,
html[data-theme="dark"] .btp-ethereum-gas-calculator__actions button,
html[data-theme="dark"] .btp-ethereum-gas-calculator__actions a,
html[data-theme="dark"] .btp-ethereum-gas-calculator__result-actions button,
html[data-theme="dark"] .btp-ethereum-gas-calculator__trace > button,
html[data-theme="dark"] .btp-ethereum-gas-calculator__comparison-grid button,
html[data-theme="dark"] .btp-ethereum-gas-calculator__mode button.is-active {
  color: var(--eth-gas-ink);
  background: #102033;
}

html[data-theme="dark"] .btp-ethereum-gas-calculator__result {
  background: linear-gradient(180deg, #132941 0%, #102033 62%);
}

html[data-theme="dark"] .btp-ethereum-gas-calculator__suffix span {
  border-color: var(--eth-gas-line);
  color: var(--eth-gas-muted);
  background: var(--eth-gas-soft);
}

html[data-theme="dark"] .btp-ethereum-gas-calculator__actions .btp-button {
  color: #fff;
  background: var(--eth-gas-accent);
}

@media (max-width: 860px) {
  .btp-ethereum-gas-calculator__workspace,
  .btp-ethereum-gas-calculator__comparison {
    grid-template-columns: 1fr;
  }

  .btp-ethereum-gas-calculator__result {
    position: static;
  }
}

@media (max-width: 560px) {
  .btp-ethereum-gas-calculator__mode {
    display: grid;
    width: 100%;
  }

  .btp-ethereum-gas-calculator__grid,
  .btp-ethereum-gas-calculator__metrics,
  .btp-ethereum-gas-calculator__comparison-grid {
    grid-template-columns: 1fr;
  }

  .btp-ethereum-gas-calculator__inputs,
  .btp-ethereum-gas-calculator__result,
  .btp-ethereum-gas-calculator__comparison {
    padding: 18px;
  }

  .btp-ethereum-gas-calculator__actions button,
  .btp-ethereum-gas-calculator__actions a,
  .btp-ethereum-gas-calculator__result-actions button {
    flex: 1 1 140px;
  }

  .btp-ethereum-gas-calculator__trace dl div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btp-ethereum-gas-calculator * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
