:root {
  color-scheme: light;
  --base-blue: #0000ff;
  --cq-purple: #6431f7;
  --ink: #0a0b0d;
  --gray-80: #32353d;
  --gray-60: #5b616e;
  --gray-50: #717886;
  --gray-30: #b1b7c3;
  --gray-15: #dee1e7;
  --gray-10: #eef0f3;
  --white: #ffffff;
  --success: #19783f;
  --failure: #c32d16;
  --l2: #0000ff;
  --l1: #6431f7;
  --other: #717886;
  --pico-font-family-sans-serif: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pico-font-family-monospace: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --pico-border-radius: 2px;
  --pico-primary: #0000ff;
  --pico-primary-background: #0000ff;
  --pico-primary-border: #0000ff;
  --pico-primary-hover: #0000d6;
  --pico-primary-hover-background: #0000d6;
  --pico-primary-hover-border: #0000d6;
  --pico-form-element-focus-color: rgba(0, 0, 255, 0.16);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

.icon-symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.button-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

html {
  background: var(--gray-10);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--gray-80);
  background: var(--gray-10);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.page-shell {
  flex: 1 0 auto;
}

.site-footer {
  flex: 0 0 auto;
}

button,
input {
  font: inherit;
}

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

a {
  color: var(--base-blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(0, 0, 255, 0.2);
  outline-offset: 3px;
}

.page-shell {
  width: min(100% - 2rem, 820px);
  margin-inline: auto;
}

.page-shell {
  padding-block: 4.5rem 3.5rem;
}

.intro {
  max-width: 720px;
  margin-bottom: 2.25rem;
}

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

h1 {
  margin-bottom: 1rem;
  color: var(--ink);
  font-size: clamp(2.8rem, 10vw, 5rem);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.065em;
}

h1 span {
  color: var(--base-blue);
}

h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.checker,
.receipt {
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--white);
}

.checker {
  padding: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
}

.input-row {
  display: grid;
  gap: 0.75rem;
}

input[type="text"] {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  margin: 0;
  border: 1px solid var(--gray-30);
  border-radius: 2px;
  padding: 0.75rem 0.9rem;
  color: var(--ink);
  background: var(--gray-10);
  box-shadow: none;
  font-family: var(--pico-font-family-monospace);
  font-size: 16px;
}

input[type="text"]:hover {
  border-color: var(--gray-50);
}

input[type="text"]:focus {
  border-color: var(--base-blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(0, 0, 255, 0.12);
}

input[aria-invalid="true"] {
  border-color: var(--failure);
}

#submit-button {
  min-height: 54px;
  margin: 0;
  border: 1px solid var(--base-blue);
  border-radius: 2px;
  padding: 0.75rem 1.3rem;
  color: var(--white);
  background: var(--base-blue);
  box-shadow: none;
  font-weight: 750;
  cursor: pointer;
}

#submit-button:hover {
  border-color: #0000d6;
  background: #0000d6;
}

#submit-button:active:not(:disabled) {
  border-color: var(--ink);
  background: var(--ink);
}

#submit-button:disabled {
  border-color: var(--gray-30);
  background: var(--gray-30);
  cursor: wait;
  opacity: 1;
}

.form-message {
  margin-bottom: 0;
  color: var(--gray-60);
  font-size: 0.82rem;
}

.form-message {
  min-height: 1.35rem;
  margin-top: 0.35rem;
}

.form-message.is-error {
  color: var(--failure);
}

.receipt {
  margin-top: 1rem;
  overflow: hidden;
}

.result-toolbar,
.total-fee,
.breakdown,
.receipt-details,
.failed-note,
.receipt-footer {
  padding: 1.25rem 1.5rem;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--gray-15);
}

.status-label {
  margin: 0;
  color: var(--success);
  font-size: 0.88rem;
  font-weight: 750;
}

.status-label.is-failed {
  color: var(--failure);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.secondary-action {
  display: inline-flex;
  min-height: 38px;
  margin: 0;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 0.45rem 0.75rem;
  color: var(--ink);
  background: var(--white);
  box-shadow: none;
  font-size: 0.8rem;
  font-weight: 750;
  cursor: pointer;
}

.secondary-action:hover {
  color: var(--white);
  background: var(--ink);
}

.secondary-action.is-copied,
.copy-value-button.is-copied {
  color: var(--success);
}

.copy-value-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  margin: 0;
  border: 0;
  border-radius: 2px;
  padding: 0;
  color: var(--gray-50);
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.copy-value-button:hover {
  color: var(--ink);
  background: var(--gray-10);
}

.copy-value-button:disabled {
  color: var(--gray-30);
  background: transparent;
  cursor: default;
}

.total-fee {
  padding-top: 2rem;
  padding-bottom: calc(2rem + env(safe-area-inset-bottom));
}

.total-fee p {
  margin-bottom: 0.35rem;
  color: var(--gray-60);
  font-size: 0.86rem;
}

.total-fee output {
  display: block;
  overflow-wrap: anywhere;
  color: var(--base-blue);
  font-family: var(--pico-font-family-monospace);
  font-size: clamp(1.55rem, 6vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.total-fee-heading,
.copyable-line,
.hash-copy-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.4rem;
}

.total-fee-heading {
  justify-content: space-between;
}

.total-fee-heading p {
  margin-bottom: 0;
}

.total-fee .historic-usd {
  margin-top: 0.4rem;
  margin-bottom: 0;
}

.fee-bar {
  display: flex;
  height: 12px;
  margin-inline: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--gray-15);
}

.fee-bar span {
  display: block;
  min-width: 0;
}

.fee-bar-l2,
.key-l2 {
  background: var(--l2);
}

.fee-bar-l1,
.key-l1 {
  background: var(--l1);
}

.fee-bar-other,
.key-other {
  background: var(--other);
}

.breakdown {
  display: grid;
}

.breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding-block: 1rem;
  border-bottom: 1px solid var(--gray-15);
}

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

.breakdown-row > div:first-child {
  display: grid;
  grid-template-columns: 11px minmax(0, 1fr);
  column-gap: 0.7rem;
  align-items: center;
}

.key {
  width: 11px;
  height: 11px;
}

.breakdown-row strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.breakdown-value {
  text-align: right;
}

.breakdown-value .copyable-line {
  justify-content: flex-end;
}

.breakdown-value span,
.breakdown-value small {
  display: block;
}

.breakdown-value span {
  color: var(--ink);
  font-family: var(--pico-font-family-monospace);
  font-size: 0.82rem;
}

.breakdown-value small {
  color: var(--gray-60);
}

.receipt-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  border-top: 1px solid var(--ink);
  padding: 0;
  background: var(--gray-30);
}

.receipt-details > div {
  min-width: 0;
  padding: 1rem 1.5rem;
  background: var(--white);
}

.receipt-details .detail-wide {
  grid-column: 1 / -1;
}

dt {
  color: var(--gray-60);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--pico-font-family-monospace);
  font-size: 0.88rem;
}

dd.copyable-line {
  justify-content: space-between;
}

.failed-note {
  margin: 0;
  border-top: 1px solid #efc7c4;
  border-bottom: 1px solid #efc7c4;
  color: #74231e;
  background: #fff7f6;
}

.receipt-footer {
  display: grid;
  gap: 0.75rem;
  border-top: 1px solid var(--gray-15);
}

.receipt-footer code {
  overflow: hidden;
  color: var(--gray-60);
  background: transparent;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hash-copy-row code {
  min-width: 0;
  flex: 1 1 auto;
}

.receipt-footer a {
  width: fit-content;
  font-weight: 700;
}

.site-footer {
  width: 100%;
  border-top: 1px solid var(--gray-30);
  padding-block: 2rem;
  color: var(--gray-60);
  background: var(--white);
  font-size: 0.82rem;
}

.footer-inner {
  width: min(100% - 2rem, 820px);
  margin-inline: auto;
}

.footer-top,
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.footer-top {
  padding-bottom: 1.25rem;
}

.footer-bottom {
  border-top: 1px solid var(--gray-15);
  padding-top: 1.25rem;
  font-size: 0.78rem;
}

.footer-brand {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.25rem;
}

.site-footer nav a {
  color: var(--gray-80);
}

@media (min-width: 640px) {
  .page-shell,
  .footer-inner {
    width: min(100% - 3rem, 820px);
  }

  .input-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #submit-button {
    min-width: 138px;
  }

  .receipt-footer {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}

@media (max-width: 479px) {
  .page-shell {
    padding-top: max(3.25rem, calc(1.5rem + env(safe-area-inset-top)));
    padding-bottom: 2.5rem;
  }

  .checker {
    padding: 1.15rem;
  }

  .breakdown-row {
    grid-template-columns: 1fr;
  }

  .breakdown-value {
    padding-left: 1.7rem;
    text-align: left;
  }

  .breakdown-value .copyable-line {
    justify-content: flex-start;
  }

  .result-toolbar {
    align-items: center;
  }

  .secondary-action {
    min-height: 44px;
  }

  .copy-value-button {
    width: 36px;
    height: 36px;
  }

  .total-fee output {
    font-size: 1.25rem;
  }
}

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