:root {
  --bg: #0c0d10;
  --bg-raise: #14161c;
  --bg-input: #0a0b0e;
  --line: #2a2e38;
  --text: #e8e6df;
  --muted: #8b907f;
  --accent: #d6b25e;
  --accent-dim: #8a6e2f;
  --ok: #7dbe6a;
  --warn: #e0a34a;
  --bad: #d46a6a;
  --pending: #7aa0d4;
  --mono: "IBM Plex Mono", "SF Mono", "Cascadia Mono", ui-monospace, Menlo, monospace;
  --sans: "IBM Plex Sans", "Source Han Sans SC", "Noto Sans SC", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }

.app { max-width: 1120px; margin: 0 auto; padding: 32px 20px 80px; }
header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 28px; }
h1 { font-size: 22px; font-weight: 560; letter-spacing: 0.02em; margin: 0 0 6px; }
.lede { color: var(--muted); margin: 0; max-width: 42em; line-height: 1.55; font-size: 13.5px; }
.badge { border: 1px solid var(--line); padding: 8px 12px; font-size: 12px; color: var(--muted); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } header { flex-direction: column; } }

.card { background: var(--bg-raise); border: 1px solid var(--line); padding: 16px 18px 18px; }
.card h2 { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }

label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 6px; }
input[type="text"], input[type="number"], textarea, select {
  width: 100%; background: var(--bg-input); border: 1px solid var(--line); padding: 8px 10px;
}
textarea { min-height: 140px; resize: vertical; font-family: var(--mono); font-size: 12px; line-height: 1.45; }
input:focus, textarea:focus, select:focus, button:focus { outline: 1px solid var(--accent-dim); outline-offset: 1px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 180px; }

button {
  background: transparent; border: 1px solid var(--line); padding: 8px 14px; cursor: pointer;
}
button.primary { background: var(--accent); color: #16130b; border-color: var(--accent); font-weight: 600; }
button.danger { background: #6e2c2c; color: #f3e7e7; border-color: #8a3b3b; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.ghost { color: var(--muted); }

.wallet { font-family: var(--mono); font-size: 13px; }
.wallet strong { color: var(--accent); font-weight: 600; }
.meta { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.warn { color: var(--warn); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }

.preview {
  margin-top: 16px; width: 100%; border-collapse: collapse; font-size: 12.5px;
  font-family: var(--mono);
}
.preview th, .preview td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.preview th { color: var(--muted); font-weight: 500; font-family: var(--sans); font-size: 11px; letter-spacing: 0.04em; }
.preview td.num, .preview th.num { text-align: right; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.status-ok { background: var(--ok); }
.status-fail { background: var(--bad); }
.status-pending { background: var(--pending); }
.status-skip { background: var(--muted); }

.totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 16px; }
@media (max-width: 700px) { .totals { grid-template-columns: 1fr 1fr; } }
.tot { border: 1px solid var(--line); padding: 10px 12px; }
.tot span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.tot b { font-family: var(--mono); font-size: 16px; font-weight: 550; }

.confirm-box { border: 1px solid var(--accent-dim); padding: 12px 14px; margin: 12px 0; background: #16140e; }
.confirm-box label { color: var(--text); font-size: 13px; display: flex; gap: 8px; align-items: flex-start; margin: 0; cursor: pointer; }
.log { margin-top: 16px; font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: pre-wrap; max-height: 220px; overflow: auto; }

a { color: var(--accent); }
.hash { font-size: 11px; word-break: break-all; }
.file { font-size: 12px; color: var(--muted); }

.tabs { display: flex; gap: 0; margin: -8px 0 22px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 10px 16px; margin-bottom: -1px; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.panel[hidden] { display: none !important; }
.keys-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.sale-status { font-size: 13px; color: var(--text); margin: 0 0 8px; }
