:root {
  --bg: #0b0e14;
  --panel: #141922;
  --panel2: #1b2230;
  --line: #26303f;
  --text: #e6e9ef;
  --muted: #8b96a8;
  --accent: #4ade80;
  --accent2: #22d3ee;
  --danger: #f87171;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent2); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }

/* ---------- header ---------- */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.right { display: flex; align-items: center; gap: 10px; }

.pill {
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; font-size: 13px;
}

/* ---------- nav ---------- */
nav {
  display: flex; gap: 4px; padding: 0 20px;
  border-bottom: 1px solid var(--line); background: var(--panel);
  overflow-x: auto;
}
nav button {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); padding: 11px 14px; cursor: pointer; font-size: 14px;
  white-space: nowrap;
}
nav button:hover { color: var(--text); }
nav button.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- layout ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
h1 { font-size: 30px; margin: 10px 0; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.lead { color: var(--muted); max-width: 620px; font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 24px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h3 { margin-top: 0; color: var(--accent); text-transform: none; letter-spacing: 0; font-size: 15px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }

@media (max-width: 780px) {
  .grid2, .cards { grid-template-columns: 1fr; }
}

/* ---------- forms ---------- */
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.form { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }

input, select {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; font-size: 14px; flex: 1 1 140px; min-width: 0;
}
input:focus, select:focus { outline: none; border-color: var(--accent2); }
label { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }
label.check { display: flex; align-items: center; gap: 6px; margin: 0; flex: 0 0 auto; }
label.check input { flex: 0 0 auto; width: auto; }

button {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 16px; font-size: 14px; cursor: pointer; flex: 0 0 auto;
}
button:hover { border-color: var(--accent2); }
button.primary { background: var(--accent); border-color: var(--accent); color: #08240f; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.link { background: none; border: none; color: var(--accent2); padding: 2px 6px; }
button.danger { color: var(--danger); }
button:disabled { opacity: .5; cursor: not-allowed; }

/* Address chip in the header. Doubles as the disconnect control: hovering
   swaps the label to "Disconnect" via the ::after overlay. */
button.account {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; border-radius: 999px; padding: 7px 14px;
  position: relative;
}
button.account:hover { border-color: var(--danger); color: transparent; }
button.account:hover::after {
  content: 'Disconnect';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--danger);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.chips { display: flex; gap: 6px; margin: 6px 0; }
.chip { padding: 5px 12px; font-size: 13px; }

details { margin-top: 14px; }
summary { cursor: pointer; color: var(--muted); font-size: 13px; }

/* ---------- data ---------- */
table.kv { width: 100%; border-collapse: collapse; }
table.kv th {
  text-align: left; font-weight: 500; color: var(--muted);
  padding: 7px 0; width: 130px; font-size: 13px;
}
table.kv td { padding: 7px 0; }

.list { display: flex; flex-direction: column; gap: 6px; }
.item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; font-size: 14px;
}
.item .meta { color: var(--muted); font-size: 12.5px; }
.item code { vertical-align: middle; }
.premium-lock {
  display: inline-block; margin-left: 6px; cursor: pointer;
  font-size: 13px; line-height: 1; filter: saturate(.7);
  transition: transform .1s ease; user-select: none;
}
.premium-lock:hover { transform: scale(1.25); }
.premium-lock.open { filter: none; }

/* modal */
.modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2147483000;
  background: rgba(4, 7, 10, 0.7);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow: auto;
}
.modal.hidden { display: none !important; }
body.modal-open { overflow: hidden; }
.modal-card {
  background: var(--panel, #141922);
  border: 1px solid var(--line, #2a3833);
  border-radius: var(--radius, 12px);
  padding: 22px 24px; max-width: 400px; width: 100%;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  margin: auto;
}
.modal-card h2 { margin: 0 0 10px; font-size: 18px; color: var(--text); }
.modal-card p { margin: 0 0 18px; color: var(--muted); line-height: 1.5; }
.modal-card .row { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.item .actions { display: flex; gap: 4px; }
.empty { color: var(--muted); font-size: 13px; padding: 8px 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.stat b { display: block; font-size: 20px; margin-bottom: 2px; }
.stat span { color: var(--muted); font-size: 12.5px; }

pre.code {
  background: #070a10; border: 1px solid var(--line); border-radius: 8px;
  padding: 14px; overflow-x: auto; font-size: 13px; line-height: 1.5;
  color: #c9d3e3;
}

.status { border-radius: 8px; padding: 10px 12px; margin-top: 10px; font-size: 13.5px; border: 1px solid var(--line); background: var(--panel2); }
.status.ok { border-color: var(--accent); }
.status.bad { border-color: var(--danger); color: #ffd3d3; }
.status code { word-break: break-all; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; padding: 11px 18px; font-size: 14px; z-index: 100;
  max-width: 90vw;
}
.toast.bad { border-color: var(--danger); }
.toast.ok { border-color: var(--accent); }
