:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --ink: #151a18;
  --muted: #65706b;
  --line: #d9ddd8;
  --surface: #ffffff;
  --panel: #fbfcfa;
  --accent: #008a5a;
  --accent-2: #d69a00;
  --danger: #b42318;
  --shadow: 0 12px 34px rgba(21, 26, 24, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
  padding: 24px 18px;
}

.workspace {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  border-radius: 8px;
  color: white;
  background: #008a5a;
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 1.24rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.purpose-line {
  max-width: 440px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.env-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.language-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(38px, 1fr));
  min-height: 32px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.language-switch button {
  min-height: 26px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  cursor: pointer;
}

.language-switch button[aria-pressed="true"] {
  color: #fff;
  background: var(--accent);
}

.language-switch button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.env-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.metrics div {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.metrics span,
.label,
legend,
.field span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.metrics strong {
  font-size: 1.15rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 12px;
}

.faucet-panel,
.status-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.faucet-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.chain-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.chain-option,
.quick-row button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.chain-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  text-align: left;
}

.chain-option span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.chain-option b {
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.chain-option small,
.chain-option em {
  color: var(--muted);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.chain-option[aria-pressed="true"] {
  border-color: var(--accent);
  background: #e9f7f1;
}

.chain-option:disabled {
  color: #98a29d;
  cursor: not-allowed;
  background: #f1f3f2;
}

.field {
  display: grid;
  gap: 0;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(23, 105, 170, 0.13);
}

.token-field {
  display: none;
}

.quick-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.quick-row button:hover,
.chain-option:hover:not(:disabled) {
  border-color: var(--accent-2);
}

.primary {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-weight: 850;
  cursor: pointer;
}

.primary:disabled {
  cursor: wait;
  background: #8aa89b;
}

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

.status-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.status-block strong {
  font-size: 1.1rem;
}

code,
#claim-detail {
  overflow-wrap: anywhere;
}

code {
  color: var(--accent-2);
  font-size: 0.82rem;
}

#claim-detail {
  min-height: 44px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.tx-link {
  display: none;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--accent-2);
  font-weight: 800;
  text-decoration: none;
}

.tx-link.is-visible {
  display: flex;
}

.is-error {
  color: var(--danger);
}

@media (max-width: 760px) {
  .shell {
    padding: 18px 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 12px;
  }

  .topbar-actions {
    justify-items: start;
    width: 100%;
  }

  .env-strip {
    justify-content: flex-start;
  }

  .metrics,
  .layout {
    grid-template-columns: 1fr;
  }

  .faucet-panel,
  .status-panel {
    padding: 16px;
  }

  .chain-switch {
    grid-template-columns: 1fr;
  }
}
