:root {
  --bg: #0b0d12;
  --panel: #131722;
  --line: #232a3a;
  --line2: #2c3550;
  --text: #eef1f7;
  --muted: #8b93a7;
  --faint: #5c6478;
  --accent: #c8f04f;
  --accent2: #7ce0b0;
  --danger: #ff6b6b;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(200, 240, 79, 0.07), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(124, 224, 176, 0.05), transparent 60%),
    var(--bg);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
main { max-width: 1180px; margin: 0 auto; padding: 0 20px 60px; }

.top {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: Syne, sans-serif; font-weight: 800; letter-spacing: 0.04em; }
.brand-mark { color: var(--accent); font-size: 1.3rem; }
.brand-tag { color: var(--faint); font-size: 0.75rem; padding-left: 34px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.chain-tabs {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
}
.ctab {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
}
.ctab.on { background: var(--accent); color: #10130a; }
.chain-bar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 8px;
  color: var(--muted);
  font-size: 0.8rem;
}
.chain-bar code { font-family: ui-monospace, monospace; }

.connect-btn, .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #10130a;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 11px 18px;
  border-radius: 12px;
  width: 100%;
}
.connect-btn { width: auto; }
.connect-btn.connected .dot { background: #0a7d32; opacity: 1; }
.connect-btn .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #10130a; opacity: 0.5;
}
.primary:disabled, .connect-btn:disabled, .ghost-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.primary.full { width: 100%; }

.ghost-btn {
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line2);
  background: var(--panel);
  white-space: nowrap;
}
.ghost-btn:hover { border-color: var(--accent); }

.hero { padding: 36px 0 22px; }
.hero h1 {
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.08;
}
.grad {
  background: linear-gradient(92deg, var(--accent) 10%, var(--accent2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub { color: var(--muted); max-width: 640px; margin-top: 12px; }

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.accent-card { border-color: rgba(200, 240, 79, 0.35); box-shadow: 0 0 0 1px rgba(200, 240, 79, 0.08); }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 0;
}
.card-head h2 { font-family: Syne, sans-serif; font-size: 1.05rem; }
.card-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
}
.pill.warn { color: #10130a; background: var(--accent); border-color: transparent; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field span { color: var(--faint); font-size: 0.75rem; font-weight: 600; }
.field input, .addr-row input {
  background: #0d1017;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  width: 100%;
}
.field input:focus, .addr-row input:focus { outline: none; border-color: var(--accent); }
.field-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.addr-row { display: flex; gap: 8px; }
.addr-row input { flex: 1; }

.fee-note {
  background: #0d1017;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
}
.fee-note div { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.fee-note b { color: var(--text); font-weight: 600; }
.muted { color: var(--muted); font-size: 0.85rem; }
.check { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 0.82rem; }
.check input { margin-top: 3px; }
.btn-row { display: flex; gap: 8px; }
.btn-row .primary, .btn-row .ghost-btn { flex: 1; }

.ctor-box { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.ctor-box summary { cursor: pointer; color: var(--muted); font-size: 0.82rem; }

.state-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.st {
  background: #0d1017;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}
.st span { display: block; color: var(--faint); font-size: 0.7rem; }
.st b { font-size: 0.85rem; }
.mono { font-family: ui-monospace, monospace; font-size: 0.75rem; }
.short { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.state-links { font-size: 0.8rem; }
.state-links a { color: var(--accent2); }
.ctl-group { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.ctl-title { color: var(--faint); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

.step-msg { min-height: 1.2em; font-size: 0.82rem; color: var(--muted); word-break: break-word; }
.step-msg.ok { color: var(--accent2); }
.step-msg.err { color: var(--danger); }

.foot { margin-top: 28px; color: var(--faint); font-size: 0.78rem; }
.foot-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 0.2s;
  max-width: 360px;
}
.toast.on { opacity: 1; transform: none; }
