:root {
  color-scheme: dark;
  --bg: #111418;
  --panel: #1a1f26;
  --panel-soft: #202732;
  --text: #eef2f6;
  --muted: #aab5c2;
  --accent: #61d394;
  --accent-dark: #2f9f67;
  --danger: #ff7878;
  --line: #303946;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: var(--accent);
}

.topbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: #151a20;
}

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}

nav a {
  text-decoration: none;
}

.container {
  width: min(1040px, calc(100% - 2rem));
  margin: 2rem auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(1rem, 3vw, 1.5rem);
  margin-bottom: 1rem;
}

.hero h1 {
  max-width: 780px;
  margin-top: 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
}

.hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.narrow {
  max-width: 520px;
}

label {
  display: block;
  margin: 1rem 0 .3rem;
  color: var(--muted);
}

input {
  width: 100%;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1318;
  color: var(--text);
}

.checkbox-row {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
}

.checkbox-row input {
  width: auto;
  margin-top: .2rem;
}

textarea {
  width: 100%;
  min-height: 9rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1318;
  color: var(--text);
  font: inherit;
  resize: vertical;
}

pre.challenge {
  overflow-x: auto;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1318;
  white-space: pre-wrap;
  word-break: break-word;
}

button,
.button {
  display: inline-block;
  margin-top: 1rem;
  padding: .72rem 1rem;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #07120c;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: var(--accent-dark);
  color: #fff;
}

.inline {
  display: inline;
}

.inline button {
  margin: 0;
  padding: .4rem .65rem;
}

.message {
  padding: .8rem 1rem;
  border-radius: 6px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.message.error,
.warning {
  border-color: #804a4a;
  color: #ffd1d1;
}

.message.success {
  border-color: #347450;
  color: #c9f7d7;
}

code {
  word-break: break-all;
  color: #c6e7ff;
}

.facts {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: .55rem 1rem;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
}

.qr {
  display: block;
  width: 220px;
  height: 220px;
  margin: 1rem 0;
  background: #fff;
  border-radius: 8px;
}

.qr-small {
  width: 96px;
  height: 96px;
  margin: .25rem 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: .65rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-weight: 600;
}

.status {
  color: var(--muted);
}

.rpc-result {
  margin-top: 1.25rem;
}

.auth-alt {
  margin-top: 1rem;
  color: var(--muted);
}

.copy-status {
  display: inline-block;
  margin-left: .75rem;
  color: var(--muted);
}

.balance-summary {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.balance-amount {
  margin: .25rem 0 0;
  font-size: 1.45rem;
  font-weight: 700;
}

.history {
  margin-top: 1.5rem;
}

.history-entry {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.history-entry p {
  margin: .25rem 0;
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .facts {
    grid-template-columns: 1fr;
  }
}
