:root {
  color-scheme: light;
  --bg: #e6e1d6;
  --paper: #fbfaf6;
  --ink: #1f1c16;
  --muted: #4f4a42;
  --line: #d5cec0;
  --accent: #c4511a;
  --danger: #7a261c;
  --danger-bg: #f8e6e2;
  --ok: #145c38;
  --ok-bg: #e5f2ea;
  --warn-bg: #f8efe2;
  --warn: #6a3d12;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 70% 40% at 50% -10%, rgba(196, 81, 26, 0.08), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.wrap {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 48px 20px 64px;
}

.mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.swatch {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 2px;
}

h1 {
  margin: 10px 0 8px;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-size: clamp(40px, 8vw, 52px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.lede,
.foot {
  margin: 0;
  color: var(--muted);
}

.lede { margin-bottom: 22px; }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 18px 40px rgba(60, 45, 20, 0.06);
}

.kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.balance {
  margin: 4px 0 0;
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: clamp(36px, 10vw, 48px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.balance #unit {
  font-family: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
  color: var(--muted);
}

.addr { margin-top: 16px; }

.addr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.addr code {
  display: block;
  margin-top: 6px;
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.addr a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: #c4bbaa;
  text-underline-offset: 3px;
}

.addr a:hover { text-decoration-color: currentColor; }

#address {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
}

.note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.details { margin-top: 4px; }

.detail {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 8px 0;
  border-top: 1px solid #ece6da;
}

.detail dt {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.detail dd {
  margin: 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.detail a { color: inherit; }

#add-wallet { margin-top: 12px; }

.meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #ece6da;
  color: var(--muted);
  font-size: 14px;
}

form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

input {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

input::placeholder { color: #8a8478; }

button {
  font: inherit;
  cursor: pointer;
}

.primary {
  height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

.primary:hover { background: #000; }

.primary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.ghost {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.ghost:hover { background: #f3efe6; }

.banner,
.message {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
}

.banner {
  background: var(--warn-bg);
  color: var(--warn);
}

.message.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.message.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.message p { margin: 0; }

.message code {
  display: block;
  margin: 6px 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.message a {
  color: inherit;
  font-weight: 600;
}

.foot { margin-top: 14px; font-size: 13px; }
.foot a { color: inherit; font-weight: 600; margin-left: 0.75em; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .wrap { padding-top: 28px; }
  .meta { flex-direction: column; gap: 4px; }
  .detail { grid-template-columns: 1fr auto; }
  .detail dt { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .primary, .ghost { transition: none; }
}
