:root {
  --accent: #6d5efc;
  --radius: 16px;
  --sans: "Inter var", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

[data-theme="light"] {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f3f4f7;
  --border: rgba(15, 20, 40, .08);
  --border-strong: rgba(15, 20, 40, .16);
  --text: #11131a;
  --text-2: #4b5165;
  --text-3: #858a9c;
  --logo: #333333;
  --code-bg: #0f1117;
  --shadow: 0 1px 2px rgba(15, 20, 40, .04), 0 12px 28px -20px rgba(15, 20, 40, .16);
  --ok: #059669;
  --warn: #d97706;
  --bad: #dc2626;
  --info: #2563eb;
}

[data-theme="dark"] {
  --bg: #0a0b0f;
  --surface: #12141a;
  --surface-2: #1a1d25;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #eceef4;
  --text-2: #a6abba;
  --text-3: #6f7486;
  --logo: #f5dba4;
  --code-bg: #0c0e14;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 16px 32px -24px rgba(0, 0, 0, .8);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --info: #60a5fa;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
#app { flex: 1; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg[aria-hidden="true"] { width: 16px; height: 16px; flex: none; }
code, .mono { font-family: var(--mono); font-size: .9em; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
/* center on the viewport rather than the space next to the scrollbar, so pages with and without one line up */
@media (min-width: 1240px) {
  .wrap { margin-left: calc((100vw - 1180px) / 2); margin-right: 0; }
}

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--logo); }
.brand svg.wordmark { width: auto; height: 24px; display: block; }
.brand .product { padding-left: 12px; border-left: 1px solid var(--border-strong); color: var(--text-2); font-size: 14px; font-weight: 550; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a, .icon-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px; border-radius: 10px;
  color: var(--text-2); font-size: 14px; border: 1px solid transparent; background: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.nav a:hover, .icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn { width: 36px; padding: 0; justify-content: center; }

/* ---------- page head ---------- */
.page-head { padding: 40px 0 24px; }
.page-head h1 { margin: 0; font-size: 34px; letter-spacing: -.03em; line-height: 1.15; }
.page-head p { margin: 8px 0 0; max-width: 680px; color: var(--text-2); font-size: 16px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.stat-k { color: var(--text-3); font-size: 12.5px; }
.stat-v { margin-top: 4px; font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-v small { color: var(--text-3); font-weight: 550; font-size: 16px; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.search { position: relative; flex: 1 1 260px; max-width: 380px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search input {
  width: 100%; height: 38px; padding: 0 40px 0 36px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { outline: none; background: var(--surface); border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 11px; color: var(--text-3); border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; background: var(--surface);
}
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented button {
  height: 30px; padding: 0 11px; border: 0; border-radius: 8px; background: none; color: var(--text-2); cursor: pointer; font-size: 13px; white-space: nowrap;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15, 20, 40, .12); }
.toolbar .count { margin-left: auto; color: var(--text-3); font-size: 13px; }

/* ---------- chain list ---------- */
.rows { display: flex; flex-direction: column; }
.crow {
  display: grid; align-items: center; gap: 14px; padding: 12px 18px;
  grid-template-columns: minmax(200px, 2.2fr) 1fr .9fr 1.1fr 1.2fr .8fr 104px 16px;
  border-top: 1px solid var(--border); font-size: 14px;
  transition: background .15s;
}
.crow:first-child { border-top: 0; }
.crow.head { padding-top: 10px; padding-bottom: 10px; color: var(--text-3); font-size: 12px; font-weight: 550; text-transform: uppercase; letter-spacing: .06em; }
a.crow { animation: rise .3s var(--ease) both; }
a.crow:hover { background: var(--surface-2); }
.crow .chain { display: flex; align-items: center; gap: 12px; min-width: 0; }
.crow .name { font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow .sub { color: var(--text-3); font-size: 12px; font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.crow .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.crow .arrow { color: var(--text-3); transition: transform .2s var(--ease), color .2s; }
a.crow:hover .arrow { color: var(--text); transform: translateX(2px); }

.avatar {
  --size: 40px;
  width: var(--size); height: var(--size); flex: none; border-radius: 12px; display: grid; place-items: center; overflow: hidden;
  font-weight: 700; font-size: calc(var(--size) * .4); color: #fff; letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--chain, var(--accent)), color-mix(in srgb, var(--chain, var(--accent)) 55%, #000));
}
.avatar img { width: 100%; height: 100%; object-fit: cover; background: var(--surface); }
.avatar.sm { --size: 32px; border-radius: 9px; }
.avatar.lg { --size: 56px; border-radius: 16px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 550; white-space: nowrap; border: 1px solid var(--border); color: var(--text-2); background: var(--surface);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 28%, transparent); background: color-mix(in srgb, var(--ok) 9%, transparent); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 28%, transparent); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.pill.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 28%, transparent); background: color-mix(in srgb, var(--bad) 9%, transparent); }
.pill.info { color: var(--info); border-color: color-mix(in srgb, var(--info) 28%, transparent); background: color-mix(in srgb, var(--info) 9%, transparent); }
.pill.live .dot { animation: pulse 1.6s ease-in-out infinite; }
.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 11.5px; font-weight: 550;
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap;
}
.tag.db { font-family: var(--mono); font-size: 11px; }
.tag.accent { color: color-mix(in srgb, var(--accent) 80%, var(--text)); border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ---------- detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; margin-top: 28px; color: var(--text-2); font-size: 14px; }
.back:hover { color: var(--text); }
.detail-head { display: flex; align-items: center; gap: 16px; margin: 20px 0 28px; flex-wrap: wrap; }
.detail-head h1 { margin: 0; font-size: 34px; letter-spacing: -.03em; line-height: 1.1; }
.detail-head .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.db-switch { display: flex; align-items: center; gap: 10px; margin-left: auto; color: var(--text-3); font-size: 13px; }
.db-switch .segmented button { font-family: var(--mono); font-size: 12.5px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; padding-bottom: 56px; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.section-title { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.section-title h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }

.panel { border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.panel-head .muted { color: var(--text-3); font-size: 13px; }
.panel-body { padding: 18px; }

.hero-dl { position: relative; padding: 22px; }
.hero-dl::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 200px at 0% 0%, color-mix(in srgb, var(--chain, var(--accent)) 10%, transparent), transparent 70%);
}
.hero-dl > * { position: relative; }
.hero-dl .label { color: var(--text-3); font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; display: flex; gap: 8px; align-items: center; }
.hero-dl .label svg { width: 14px; height: 14px; }
.hero-dl .fname { margin: 8px 0 18px; font-family: var(--mono); font-size: 15px; word-break: break-all; }
.hero-dl .facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.hero-dl .facts .k { color: var(--text-3); font-size: 12px; }
.hero-dl .facts .v { font-weight: 650; font-size: 18px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px;
  font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: transform .12s, filter .15s, border-color .15s, background .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { border-color: transparent; color: #fff; background: var(--accent); box-shadow: 0 8px 20px -12px var(--accent); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.ghost { background: transparent; }

.checksum {
  display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 12px; border-radius: 11px;
  border: 1px dashed var(--border-strong); background: var(--surface-2);
}
.checksum .k { color: var(--text-3); font-size: 12px; flex: none; }
.checksum code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: 12.5px; }

.tabs { display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button { position: relative; height: 46px; padding: 0 12px; border: 0; background: none; color: var(--text-2); cursor: pointer; font-size: 14px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tab-note { color: var(--text-2); font-size: 14px; margin: 0 0 14px; }

.code { border-radius: 12px; background: var(--code-bg); border: 1px solid rgba(255, 255, 255, .06); color: #d7dbe7; overflow: hidden; }
.code-head {
  display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .06); color: #7d8499; font-family: var(--mono); font-size: 12px;
}
.code pre { margin: 0; padding: 14px 18px 16px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.7; }
.code .c { color: #6b7289; }
.code .s { color: #a5e3b5; }
.code .v { color: #c4b5fd; }
.code .copy { height: 28px; background: rgba(255, 255, 255, .06); color: #c9cede; border-color: rgba(255, 255, 255, .1); }
.code .copy:hover { background: rgba(255, 255, 255, .12); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); }
.list-item:first-child { border-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 600; font-size: 14px; }
.list-item .s { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item svg { color: var(--text-3); }
a.list-item:hover { background: var(--surface-2); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-top: 1px solid var(--border); white-space: nowrap; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
thead th { border-top: 0; color: var(--text-3); font-weight: 550; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
tbody tr:hover { background: var(--surface-2); }
td.num { font-variant-numeric: tabular-nums; }
td.hash { color: var(--text-2); }
td .pill { height: 20px; padding: 0 7px; font-size: 11px; }
td .row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; font-size: 14px;
  border: 1px solid color-mix(in srgb, var(--info) 28%, transparent); background: color-mix(in srgb, var(--info) 7%, transparent); color: var(--text-2);
}
.notice svg { width: 18px; height: 18px; color: var(--info); margin-top: 1px; }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 28%, transparent); background: color-mix(in srgb, var(--warn) 7%, transparent); }
.notice.warn svg { color: var(--warn); }
.notice b { color: var(--text); font-weight: 600; }

/* ---------- states ---------- */
.empty { text-align: center; padding: 56px 24px; color: var(--text-2); }
.empty h3 { margin: 0 0 6px; color: var(--text); font-size: 17px; }
.empty.boxed { border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 6%, transparent), transparent);
  animation: shimmer 1.3s infinite;
}

.footer { border-top: 1px solid var(--border); color: var(--text-3); font-size: 13px; background: var(--surface); }
.footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; padding-top: 20px; padding-bottom: 28px; }
.footer .mirrors { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.footer .mirrors a { display: inline-flex; align-items: center; gap: 7px; }
.footer .right { margin-left: auto; display: flex; gap: 16px; }
.footer a:hover { color: var(--text); }
.sdot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.sdot.off { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; font-size: 14px;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  transition: opacity .2s, transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { color: var(--ok); }

@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes shimmer { to { transform: translateX(100%); } }

@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .crow { grid-template-columns: minmax(180px, 2fr) .9fr 1.1fr 104px 16px; }
  .hide-md { display: none !important; }
}
@media (max-width: 680px) {
  .wrap { padding: 0 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { padding-top: 28px; }
  .page-head h1, .detail-head h1 { font-size: 28px; }
  .panel-head { flex-wrap: wrap; }
  .hero-dl .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav .label, .brand .product { display: none; }
  .toolbar .count { display: none; }
  .tabs { padding: 0 4px; }
  .tabs button { padding: 0 9px; }
  .crow { grid-template-columns: minmax(0, 1fr) auto 16px; gap: 10px; padding: 12px 16px; }
  .hide-sm { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
