:root {
  --bg: #0b0f17;
  --panel: #111827;
  --panel-soft: #151e2e;
  --line: #253044;
  --text: #e8eef8;
  --muted: #8b98ad;
  --muted-2: #647086;
  --accent: #5eead4;
  --accent-2: #a78bfa;
  --good: #22c55e;
  --bad: #ef4444;
  --warn: #f59e0b;
  --shadow: 0 18px 48px rgba(0, 0, 0, .28);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(94, 234, 212, .09), transparent 30%),
    radial-gradient(circle at 80% 10%, rgba(167, 139, 250, .09), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

button, input { font: inherit; }
code { color: #c4b5fd; font-size: .92em; }
.hidden { display: none !important; }

.topbar {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.mark {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(94,234,212,.9), rgba(167,139,250,.9));
  color: #071018; font-weight: 900;
}
h1 { margin: 0; font-size: 18px; line-height: 1.2; letter-spacing: -.01em; }
.brand p, .search-copy p, .empty p, .loading p { margin: 3px 0 0; color: var(--muted); }

.node-pill {
  min-height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(17, 24, 39, .72); backdrop-filter: blur(14px);
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); white-space: nowrap;
}
.node-pill small { color: var(--muted-2); }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--good); box-shadow: 0 0 14px var(--good); }
.dot.checking { background: var(--warn); box-shadow: 0 0 14px var(--warn); }
.dot.bad { background: var(--bad); box-shadow: 0 0 14px var(--bad); }

.container { width: min(1200px, calc(100% - 32px)); margin: 0 auto 56px; }
.panel, .summary article, .tx-card, .modal {
  border: 1px solid var(--line);
  background: rgba(17, 24, 39, .82);
  box-shadow: var(--shadow);
}
.search-panel {
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(230px, 360px) 1fr;
  gap: 18px;
  align-items: center;
}
h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.search-box { display: flex; gap: 10px; }
input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
}
input:focus { border-color: rgba(94,234,212,.7); box-shadow: 0 0 0 3px rgba(94,234,212,.08); }
button {
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  min-height: 40px;
  background: linear-gradient(135deg, #2dd4bf, #8b5cf6);
  color: white;
  font-weight: 750;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
.secondary, .link-btn {
  background: rgba(255,255,255,.045);
  border: 1px solid var(--line);
  color: var(--text);
}
.link-btn { min-height: 30px; padding: 0 10px; border-radius: 9px; color: var(--muted); }
.hint-row { grid-column: 2; display: flex; align-items: center; gap: 8px; min-height: 30px; }
.derived { color: var(--muted-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; }

.summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 14px 0; }
.summary article { border-radius: 14px; padding: 13px 14px; background: rgba(17,24,39,.72); }
.summary span { color: var(--muted); font-size: 12px; }
.summary strong { display: block; margin-top: 5px; font-size: 15px; overflow-wrap: anywhere; }

.controls {
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.tabs { display: flex; gap: 7px; flex-wrap: wrap; }
.tab {
  min-height: 32px; padding: 0 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.tab.active { color: var(--text); border-color: rgba(94,234,212,.55); background: rgba(94,234,212,.09); }
.tools { display: flex; gap: 8px; min-width: 360px; }
.tools input { min-height: 36px; padding: 9px 10px; }
.tools button { min-height: 36px; }

.loading, .empty { border-radius: var(--radius); padding: 24px; display: flex; align-items: center; gap: 14px; color: var(--muted); }
.empty { display: block; text-align: center; }
.loader { width: 28px; height: 28px; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.tx-list { display: grid; gap: 8px; }
.tx-card {
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) 190px 150px 120px;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, transform .14s ease;
}
.tx-card:hover { border-color: rgba(94,234,212,.45); background: rgba(21,30,46,.95); transform: translateY(-1px); }
.type-line { display: flex; align-items: center; gap: 8px; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 800; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.badge.good { color: var(--good); }
.badge.bad { color: var(--bad); }
.kind { font-weight: 800; font-size: 13px; }
.muted { color: var(--muted); font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.validator-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amount { font-weight: 850; text-align: right; }
.time { color: var(--text); font-size: 13px; }
.height { text-align: right; }

.modal {
  width: min(820px, calc(100% - 24px));
  border-radius: 18px;
  padding: 0;
  color: var(--text);
}
.modal::backdrop { background: rgba(3, 7, 18, .72); backdrop-filter: blur(6px); }
.modal-header { padding: 18px 20px; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: rgba(21,30,46,.82); }
.modal-kicker { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.modal-header h2 { margin-top: 4px; font-size: 17px; }
.icon-btn { width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 11px; background: rgba(255,255,255,.06); border: 1px solid var(--line); font-size: 22px; color: var(--muted); }
.modal-body { padding: 18px 20px 20px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.detail { border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px; background: rgba(255,255,255,.035); }
.detail span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.detail strong, .detail code { overflow-wrap: anywhere; }
.copy { min-height: 26px; margin-left: 8px; padding: 0 8px; border-radius: 8px; background: rgba(255,255,255,.06); border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
details { margin-top: 14px; }
summary { cursor: pointer; color: var(--accent); font-weight: 800; font-size: 13px; }
pre { white-space: pre-wrap; overflow: auto; max-height: 300px; padding: 12px; border-radius: 13px; background: rgba(0,0,0,.24); border: 1px solid var(--line); font-size: 12px; }

@media (max-width: 980px) {
  .search-panel { grid-template-columns: 1fr; }
  .hint-row { grid-column: 1; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .controls { flex-direction: column; align-items: stretch; }
  .tools { min-width: 0; }
  .tx-card { grid-template-columns: 1fr 1fr; }
  .amount, .height { text-align: left; }
}
@media (max-width: 620px) {
  .topbar, .search-box, .tools { flex-direction: column; align-items: stretch; }
  .node-pill { align-self: flex-start; }
  .summary, .detail-grid, .tx-card { grid-template-columns: 1fr; }
}
