:root, :root[data-theme="dark"] {
  --bg: #000;
  --card: #18181b;
  --card-2: #1f1f23;
  --row-line: #27272a;
  --border: #2a2a2f;
  --text: #fafafa;
  --muted: #a1a1aa;
  --dim: #71717a;
  --link: #4b8bff;
  --accent: #0a5cff;
  --accent-hover: #2b72ff;
  --green: #22c55e;
  --red: #ef4444;
  --pill: #1c1c20;
  --pill-hover: #26262b;
  --icon-tile: #f4f4f5;
  --icon-tile-fg: #52525b;
  --glow: rgba(124, 58, 237, .28);
  --select: rgba(20, 184, 166, .35);
  --badge-bg: #3b2414;
  --badge-fg: #fb923c;
  --shadow: 0 10px 40px rgba(0,0,0,.6);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f5f7;
  --card: #ffffff;
  --card-2: #f6f6f8;
  --row-line: #ececef;
  --border: #e4e4e7;
  --text: #0b0b0f;
  --muted: #52525b;
  --dim: #71717a;
  --link: #0a5cff;
  --pill: #ececef;
  --pill-hover: #e2e2e6;
  --icon-tile: #eef0f3;
  --icon-tile-fg: #52525b;
  --glow: rgba(124, 58, 237, .12);
  --select: rgba(20, 184, 166, .25);
  --badge-bg: #ffedd5;
  --badge-fg: #c2410c;
  --shadow: 0 10px 30px rgba(0,0,0,.12);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: -20vh 0 auto 0; height: 60vh; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse 45% 55% at 58% 30%, var(--glow), transparent 70%);
}
#app { position: relative; z-index: 1; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
.mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
.wrap { max-width: 1088px; margin: 0 auto; padding: 0 16px; }
::selection { background: var(--select); }

/* ── icons ── */
svg.i { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.coin { display: inline-grid; place-items: center; border-radius: 50%; background: var(--c); color: var(--g, #fff); font-weight: 800; flex: none; line-height: 1; box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }

/* ── top bar ── */
.topbar { padding: 12px 0; position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(12px); }
.topbar-inner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; flex: none; color: var(--text); margin-right: 18px; text-decoration: none; }
.brand-logo { display: block; width: 190px; height: auto; max-height: 58px; object-fit: contain; }
.brand:hover { text-decoration: none; }
.chain-select { position: relative; display: flex; align-items: center; gap: 6px; }
.chain-select .lbl { color: var(--text); font-size: 15px; }
.chain-btn { display: flex; align-items: center; gap: 8px; min-width: 228px; height: 34px; padding: 0 10px; background: transparent; border: 1px solid var(--border); border-radius: 6px; font: 600 12px "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: .02em; }
.chain-btn .caret { margin-left: auto; color: var(--muted); }
.chain-btn[aria-expanded="true"] { border-color: var(--accent); }
.chain-menu { position: absolute; top: 40px; left: 46px; width: 220px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 6px; z-index: 30; }
.chain-menu[hidden] { display: none; }
.cm-search { position: relative; margin-bottom: 6px; }
.cm-search input { width: 100%; height: 30px; border-radius: 15px; border: 1px solid var(--border); background: transparent; color: var(--text); padding: 0 30px 0 12px; font: 12px "JetBrains Mono", monospace; outline: none; }
.cm-search svg { position: absolute; right: 10px; top: 8px; width: 14px; height: 14px; color: var(--muted); }
.cm-list { list-style: none; margin: 0; padding: 0; max-height: 200px; overflow-y: auto; }
.cm-list a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; color: var(--text); font: 500 11.5px "JetBrains Mono", monospace; text-transform: uppercase; }
.cm-list a:hover, .cm-list a.on { background: var(--card-2); text-decoration: none; }
.cm-list a.cur { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.pills { display: flex; gap: 6px; margin-left: auto; }
.pill { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 17px; background: var(--pill); color: var(--text); font: 600 12px "JetBrains Mono", monospace; letter-spacing: .02em; border: 0; white-space: nowrap; }
.pill:hover { background: var(--pill-hover); text-decoration: none; }
.pill.active { background: var(--accent); color: #fff; }
.search-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 6px; background: var(--pill); border: 0; font: 500 12px "JetBrains Mono", monospace; color: var(--text); }
.search-btn:hover, .icon-btn:hover { background: var(--pill-hover); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: var(--pill); border: 0; }

/* ── landing ── */
.float-bar { position: sticky; top: 8px; z-index: 20; display: flex; justify-content: center; padding-top: 8px; }
.float-bar-inner { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 22px; background: color-mix(in srgb, var(--card) 85%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: 8px; min-width: 340px; box-shadow: var(--shadow); }
.float-bar .brand { margin-right: auto; padding-right: 24px; }
.float-bar .brand-logo { width: 210px; max-height: 62px; }
.hero { text-align: center; padding: 34px 16px 0; }
.hero h1 { font-size: clamp(30px, 4.6vw, 40px); font-weight: 700; letter-spacing: -.02em; margin: 0 0 10px; }
.hero p { color: var(--muted); margin: 0 0 28px; font-size: 16px; }
.hero-search { position: relative; max-width: 742px; margin: 0 auto; }
.hero-search input { width: 100%; height: 44px; border-radius: 22px; border: 1px solid var(--border); background: color-mix(in srgb, var(--card) 40%, transparent); color: var(--text); padding: 0 18px 0 44px; font: 15px Inter, sans-serif; outline: none; }
.hero-search input:focus { border-color: var(--accent); }
.hero-search > svg { position: absolute; left: 13px; top: 12px; width: 20px; height: 20px; color: var(--text); }
.suggest { position: absolute; left: 0; right: 0; top: 50px; text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; z-index: 15; }
.suggest:empty { display: none; }
.kicker { font: 500 12px "JetBrains Mono", monospace; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; text-align: center; margin: 64px 0 18px; }
.chain-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 17px; max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.chain-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px; padding: 20px 14px 24px; min-height: 146px; background: var(--card); border-radius: 8px; color: var(--text); text-align: center; font-weight: 700; font-size: 18px; transition: background .15s, transform .15s; }
.chain-card:hover { background: var(--card-2); text-decoration: none; transform: translateY(-2px); }
.badge { position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 4px; background: var(--badge-bg); color: var(--badge-fg); font-size: 13px; font-weight: 700; }
.ad { display: flex; align-items: center; gap: 14px; max-width: 708px; margin: 42px auto 0; padding: 10px 16px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; color: var(--text); background: color-mix(in srgb, var(--card) 40%, transparent); }
.ad .tag { font-size: 9px; color: var(--dim); letter-spacing: .05em; }
.ad .cta { margin-left: auto; white-space: nowrap; }

/* ── cards ── */
main { padding-bottom: 40px; }
.card { background: var(--card); border-radius: 12px; }
.price-card { display: grid; grid-template-columns: auto 1fr 1fr 1fr; align-items: center; gap: 24px; padding: 24px 18px; margin-top: 20px; }
.price-card .who { display: flex; align-items: center; gap: 14px; font-size: 26px; font-weight: 700; letter-spacing: -.01em; padding-right: 20px; }
.stat .k { font: 500 12px "JetBrains Mono", monospace; letter-spacing: .04em; text-transform: uppercase; color: var(--text); opacity: .85; }
.stat .v { font: 500 16px "JetBrains Mono", monospace; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.up { color: var(--green); } .down { color: var(--red); } .flat { color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--row-line); }
.panel-h h2 { font-size: 18px; margin: 0; font-weight: 700; }
.panel-h a { color: var(--text); display: grid; }
.list { padding: 0 10px; }
.row { display: flex; align-items: center; gap: 14px; padding: 9px 6px; border-bottom: 1px solid var(--row-line); min-height: 51px; }
.tile { width: 29px; height: 29px; border-radius: 6px; background: var(--icon-tile); color: var(--icon-tile-fg); display: grid; place-items: center; flex: none; }
.tile svg { width: 14px; height: 14px; stroke-width: 1.6; }
.row .main { min-width: 0; flex: 1; }
.row .main a { font: 400 13px "JetBrains Mono", monospace; }
.row .sub { font-size: 13px; color: var(--muted); }
.row .num { text-align: right; font: 500 13px "JetBrains Mono", monospace; line-height: 1.35; white-space: nowrap; }
.panel-f { display: flex; justify-content: flex-end; padding: 14px 10px 16px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; background: var(--accent); color: #fff; border: 0; border-radius: 19px; font-weight: 600; font-size: 14.5px; }
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--pill); color: var(--text); }
.fresh { animation: fresh 1.6s ease-out; }
@keyframes fresh { from { background: color-mix(in srgb, var(--accent) 22%, transparent); } to { background: transparent; } }

/* ── tables ── */
.page { margin-top: 18px; padding-bottom: 20px; }
.page-h { display: flex; align-items: center; gap: 14px; padding: 16px 22px; border-bottom: 1px solid var(--row-line); }
.page-h h1 { font-size: 19px; margin: 0; font-weight: 700; }
.page-h .back { color: var(--text); display: grid; }
.page-h .right { margin-left: auto; display: flex; gap: 6px; }
.count-note { padding: 14px 16px 6px; font-size: 13px; }
.table-scroll { overflow-x: auto; padding: 0 14px; }
table { width: 100%; border-collapse: collapse; font: 400 12px "JetBrains Mono", monospace; white-space: nowrap; }
th { text-align: left; font-weight: 600; font-size: 10px; letter-spacing: .02em; color: var(--muted); text-transform: uppercase; padding: 12px 8px 6px; }
td { padding: 7px 8px; border-top: 1px solid var(--row-line); height: 29px; }
th.r, td.r { text-align: right; } th.c, td.c { text-align: center; }
tbody tr:hover { background: color-mix(in srgb, var(--card-2) 70%, transparent); }
.load { display: flex; justify-content: center; padding: 12px 0 0; }
.load .btn { height: 30px; font-size: 13px; padding: 0 12px; }

/* ── detail ── */
.hash-line { display: flex; align-items: center; gap: 8px; font: 13px "JetBrains Mono", monospace; color: var(--muted); padding: 0 22px 14px; word-break: break-all; }
.copy { background: transparent; border: 0; color: var(--muted); padding: 2px; display: inline-grid; }
.copy:hover { color: var(--text); }
.kv { display: grid; grid-template-columns: 220px 1fr; padding: 6px 22px 10px; }
.kv > div { padding: 10px 0; border-bottom: 1px solid var(--row-line); font-size: 14px; min-width: 0; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv .k { color: var(--muted); font-size: 13px; }
.kv .v { font-family: "JetBrains Mono", monospace; font-size: 13px; word-break: break-all; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 12px; background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); font: 600 12px Inter, sans-serif; }
.flow { display: grid; grid-template-columns: 1fr 40px 1fr; gap: 0; padding: 4px 22px 18px; align-items: start; }
.flow h3 { font: 600 11px "JetBrains Mono", monospace; letter-spacing: .05em; color: var(--muted); text-transform: uppercase; margin: 6px 0 8px; }
.flow .arrow { display: grid; place-items: center; padding-top: 40px; color: var(--muted); }
.io { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; background: var(--card-2); border-radius: 8px; margin-bottom: 6px; font: 12.5px "JetBrains Mono", monospace; }
.io a, .io span.addr { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.io .amt { white-space: nowrap; text-align: right; }
.io .amt small { display: block; color: var(--muted); font-size: 11px; }
.nav-arrows { display: flex; gap: 6px; }
.sub-h { font-size: 16px; font-weight: 700; padding: 18px 22px 0; margin: 0; }
.empty { padding: 40px 22px; text-align: center; color: var(--muted); }
textarea { width: 100%; min-height: 180px; resize: vertical; background: var(--card-2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 14px; font: 13px "JetBrains Mono", monospace; outline: none; }
textarea:focus { border-color: var(--accent); }
.bc { padding: 20px 22px 24px; }
.bc p { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.bc .actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.result { margin-top: 16px; padding: 14px; border-radius: 10px; font-size: 13.5px; word-break: break-all; }
.result.ok { background: color-mix(in srgb, var(--green) 12%, transparent); border: 1px solid color-mix(in srgb, var(--green) 35%, transparent); }
.result.err { background: color-mix(in srgb, var(--red) 12%, transparent); border: 1px solid color-mix(in srgb, var(--red) 35%, transparent); }

/* ── search modal ── */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 0; }
.modal-box { width: 100%; max-width: 620px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.modal-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--row-line); }
.modal-in input { flex: 1; height: 52px; background: transparent; border: 0; outline: none; color: var(--text); font: 15px Inter, sans-serif; }
.modal-in kbd, .hint kbd { font: 11px "JetBrains Mono", monospace; padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); }
.res { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: var(--text); border-bottom: 1px solid var(--row-line); }
.res:last-child { border-bottom: 0; }
.res:hover, .res.on { background: var(--card-2); text-decoration: none; }
.res .t { font-size: 14px; font-weight: 600; }
.res .s { font: 12px "JetBrains Mono", monospace; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 470px; }
.hint { padding: 14px 16px; color: var(--muted); font-size: 13px; line-height: 1.7; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); opacity: 0; background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; transition: .2s; z-index: 60; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.foot { color: var(--dim); font-size: 12.5px; text-align: center; padding: 34px 16px 40px; }

/* ── responsive ── */
@media (max-width: 1000px) {
  .pills { margin-left: 0; order: 5; width: 100%; overflow-x: auto; }
  .chain-grid { grid-template-columns: repeat(2, 1fr); }
  .price-card { grid-template-columns: 1fr 1fr 1fr; }
  .price-card .who { grid-column: 1 / -1; }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .brand { margin-right: auto; }
  .brand-logo { width: 150px; max-height: 46px; }
  .float-bar .brand-logo { width: 165px; max-height: 48px; }
  .chain-select { order: 4; width: 100%; }
  .chain-btn { flex: 1; min-width: 0; }
  .chain-menu { left: 46px; right: 0; width: auto; }
  .search-btn .txt { display: none; }
  .float-bar-inner { min-width: 0; width: calc(100% - 32px); }
  .chain-grid { gap: 10px; }
  .chain-card { font-size: 15px; min-height: 128px; }
  .price-card { grid-template-columns: 1fr; gap: 12px; }
  .price-card .who { font-size: 22px; }
  .kv { grid-template-columns: 1fr; }
  .kv > div.k { border-bottom: 0; padding-bottom: 0; }
  .flow { grid-template-columns: 1fr; }
  .flow .arrow { padding: 4px 0; transform: rotate(90deg); }
  .ad { flex-wrap: wrap; }
}
