:root {
  color-scheme: dark;
  background: #030608;
  color: #eaf6ff;
  font: 16px/1.55 "DM Sans", system-ui, sans-serif;
}

body { margin: 0; }
a { color: #8bd9ff; text-underline-offset: .18em; }
button, select, input { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: default; }
:focus-visible { outline: 2px solid #8bd9ff; outline-offset: 3px; }

.tool-shell {
  width: min(54rem, calc(100% - 2.5rem));
  margin: auto;
}

.tool-header { border-bottom: 1px solid #233748; }
.tool-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 4rem;
}

.tool-brand { color: inherit; font-weight: 750; text-decoration: none; }
.tool-languages { display: flex; gap: .75rem; font-size: .875rem; }
.tool-languages [aria-current] { color: #eaf6ff; font-weight: 700; }
main { padding-top: clamp(1.5rem, 6vw, 3.75rem); }
h1 { margin: 0 0 1.5rem; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; }
h2 { margin: 0 0 .75rem; font-size: 1.2rem; }

form, #contract-reference {
  margin-bottom: 1.25rem;
  padding: clamp(1rem, 4vw, 1.5rem);
  border: 1px solid #233748;
  border-radius: .9rem;
  background: #0b151e;
}

fieldset {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) minmax(0, 2fr) auto;
  align-items: end;
  gap: .75rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field { display: grid; gap: .35rem; min-width: 0; }
label { font-size: .9375rem; font-weight: 600; }
input, select, button {
  box-sizing: border-box;
  min-height: 2.75rem;
  border: 1px solid #456177;
  border-radius: .5rem;
  padding: .4rem .65rem;
}

input, select { width: 100%; background: #071018; color: inherit; }
input[aria-invalid="true"] { border-color: #ffc297; }
.check-button { border-color: #89d4ff; background: #89d4ff; color: #071018; font-weight: 750; }
.check-button:disabled { opacity: .65; }
.hint { margin: .65rem 0 0; color: #b6c8d6; font-size: .9rem; }
output { display: block; font-weight: 650; }
output:not(:empty) { margin-top: .9rem; }
output[data-state="match"] { color: #a7f0d4; }
output[data-state="invalid"] { color: #ffc297; }

#token-contracts { display: grid; gap: .6rem; margin: 0 0 .9rem; padding: 0; list-style: none; }
.contract-row { padding: .75rem; border: 1px solid #233748; border-radius: .6rem; }
.contract-row h3 { margin: 0 0 .35rem; font-size: 1rem; }
.contract-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .8rem; }
.contract-actions a {
  overflow-wrap: anywhere;
  font: .875rem/1.55 ui-monospace, monospace;
}
.contract-actions button { background: #162737; color: inherit; font-size: .875rem; }
#copy-status:not(:empty) { margin-bottom: .7rem; }
.tool-footer { padding: .25rem 0 2rem; }

@media (max-width: 38rem) {
  fieldset { grid-template-columns: 1fr; }
  .contract-actions a { flex-basis: 100%; }
}
