:root {
  --bg: #f7f6f3;
  --ink: #111;
  --muted: #666;
  --faint: #999;
  --line: #e4e2dc;
  --card: #fff;
  --ok: #0d6b4c;
  --ok-bg: #eaf6f1;
  --warn-bg: #faf6ee;
  --bad: #b42318;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); font-weight: 600; }

.file-banner {
  background: #111;
  color: #fff;
  text-align: center;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.45;
}

.file-banner code {
  font-family: var(--mono);
  background: rgba(255,255,255,0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

.file-banner.hidden { display: none !important; }

.top {
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
}

.pill.on {
  color: var(--ok);
  border-color: #c6e6d7;
  background: var(--ok-bg);
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.hero { margin-bottom: 24px; max-width: 34rem; }

.hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.lead {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.98rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 740px) {
  .grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}

.card h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-sub {
  margin-top: 4px;
  margin-bottom: 14px;
  font-size: 0.88rem;
  color: var(--muted);
}

.drop {
  border: 1px dashed var(--line);
  background: var(--bg);
  border-radius: 12px;
  padding: 22px 14px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 12px;
  transition: border-color 0.12s, background 0.12s;
}

.drop:hover,
.drop:focus,
.drop.drag {
  border-color: #bbb;
  background: #f0eeea;
  outline: none;
}

.drop-title { font-weight: 600; font-size: 0.92rem; }
.drop-sub { margin-top: 4px; font-size: 0.82rem; color: var(--faint); word-break: break-all; }

.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  margin-bottom: 12px;
  font-family: var(--font);
}

.input:focus { border-color: #aaa; }
.input.mono { font-family: var(--mono); font-size: 12px; }

.hash-box {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
}

.hash-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.hash-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.hash-out {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
  word-break: break-all;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.12s, transform 0.08s;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-accent { background: var(--ink); color: #fff; }
.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.linkish {
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  min-height: 1.2em;
  word-break: break-word;
}

.status.ok { color: var(--ok); }
.status.err { color: var(--bad); }
.status a { color: var(--ok); }

.verify-out { margin-top: 12px; font-size: 14px; }

.verify-card {
  border-radius: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.verify-card.found { background: var(--ok-bg); border-color: #c6e6d7; }
.verify-card.missing { background: var(--warn-bg); border-color: #e8dcc0; }
.verify-card h3 { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.verify-card p, .verify-card dd { font-size: 13px; color: var(--muted); word-break: break-all; }
.verify-card dt {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--faint);
  margin-top: 8px;
}
.verify-card dd { margin: 2px 0 0; }

.ledger { margin-top: 14px; }

.ledger-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ledger .card-sub { margin-bottom: 0; }

.stamps-list { display: flex; flex-direction: column; gap: 8px; }

.stamp-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.stamp-item .lbl { font-weight: 600; font-size: 14px; }
.stamp-item .hx {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
}
.stamp-item .meta {
  font-size: 12px;
  color: var(--faint);
  text-align: right;
  white-space: nowrap;
}

.empty { font-size: 14px; color: var(--faint); }

.footer-line {
  margin-top: 28px;
  font-size: 13px;
  color: var(--faint);
}

.footer-line a { color: var(--muted); font-weight: 600; }

.hidden { display: none !important; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 200;
  max-width: 90vw;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Connect modal — Web3 style */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.hidden { display: none !important; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  width: min(400px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
}

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

.modal-head h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-x {
  border: none;
  background: var(--bg);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.modal-sub {
  margin-top: 6px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--muted);
}

.modal-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--faint);
  line-height: 1.4;
}

.wallet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wallet-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  font-family: var(--font);
  color: var(--ink);
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
}

.wallet-btn:hover {
  background: var(--bg);
  border-color: #ccc;
}

.wallet-btn:active { transform: scale(0.99); }

.wallet-btn .wb-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  color: #fff;
}

.wb-mm { background: #e2761b; }
.wb-rabby { background: #7084ff; }
.wb-okx { background: #000; }
.wb-coinbase { background: #0052ff; }
.wb-brave { background: #fb542b; }
.wb-any { background: #111; }

.wallet-btn img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--bg);
}

.wallet-btn .wb-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.wallet-btn .wb-name {
  font-weight: 700;
  font-size: 15px;
}

.wallet-btn .wb-rd {
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
}

.wallet-btn .wb-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--ok);
  background: var(--ok-bg);
  padding: 3px 8px;
  border-radius: 999px;
}

.wallet-btn .wb-badge.off {
  color: var(--faint);
  background: var(--bg);
}
