:root {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f0f1f4; --line: #e3e5ea;
  --ink: #15171c; --ink-2: #4b5160; --muted: #808696;
  --accent: #f26a0f; --accent-ink: #c2410c; --accent-soft: #fff1e3;
  --good: #108a52; --good-soft: #e3f5ec; --bad: #c62a2a; --bad-soft: #fbe7e7;
  --bar: #f26a0f; --grid: #eceef2;
  --shadow: 0 1px 2px rgba(16,20,30,.04), 0 2px 8px rgba(16,20,30,.04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f14; --surface: #151821; --surface-2: #1b1f2a; --line: #262b38;
    --ink: #eef0f5; --ink-2: #b2b8c6; --muted: #7d8495;
    --accent: #ff9a1f; --accent-ink: #ffb54d; --accent-soft: #3a2210;
    --good: #3ccf8a; --good-soft: #10291e; --bad: #ff6b6b; --bad-soft: #2d1414;
    --bar: #ffa40d; --grid: #222735; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f14; --surface: #151821; --surface-2: #1b1f2a; --line: #262b38;
  --ink: #eef0f5; --ink-2: #b2b8c6; --muted: #7d8495;
  --accent: #ff9a1f; --accent-ink: #ffb54d; --accent-soft: #3a2210;
  --good: #3ccf8a; --good-soft: #10291e; --bad: #ff6b6b; --bad-soft: #2d1414;
  --bar: #ffa40d; --grid: #222735; --shadow: none;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 Inter, system-ui, sans-serif; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }

.top { background: var(--surface); border-bottom: 1px solid var(--line); padding-bottom: 14px; position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 18px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); }
.brand em { font-style: normal; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
nav a { color: var(--ink-2); padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-weight: 500; }
nav a:hover { background: var(--surface-2); text-decoration: none; }
nav a.on { color: var(--accent-ink); background: var(--accent-soft); }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--ink-2); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 16px; }
.search { display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: inherit; }
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.search button, .btn { height: 42px; padding: 0 18px; border-radius: 10px; border: 0; background: var(--accent); color: #fff; font: 600 14px Inter, sans-serif; cursor: pointer; }

main { padding-top: 22px; min-height: 70vh; }
h1 { font-size: 22px; margin: 0 0 16px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h1 small { font-size: 13px; color: var(--muted); font-weight: 500; }
h2 { font-size: 15px; margin: 0; font-weight: 600; }
.loading, .empty { padding: 40px; text-align: center; color: var(--muted); }
.err { padding: 20px; border-radius: 12px; background: var(--bad-soft); color: var(--bad); }

.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .top-in { gap: 12px; } .brand em { display: none; } nav { display: none; } .top-in nav.show { display: flex; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); gap: 12px; }
.card-b { padding: 16px; }
.stat { padding: 16px; }
.stat .k { color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--ink-2); font-size: 12px; margin-top: 2px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.badge-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); font-size: 11px; font-weight: 600; }
.list .r { text-align: right; font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }

.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
td { padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.pill.ok { background: var(--good-soft); color: var(--good); }
.pill.fail { background: var(--bad-soft); color: var(--bad); }
.pill.n { background: var(--surface-2); color: var(--ink-2); }
.arrow { color: var(--muted); padding: 0 6px; }

.kv { display: grid; grid-template-columns: 200px minmax(0, 1fr); }
.kv > div { padding: 12px 16px; border-bottom: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.kv > div:nth-child(odd) { color: var(--muted); }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
@media (max-width: 640px) { .kv { grid-template-columns: minmax(0, 1fr); } .kv > div:nth-child(odd) { padding-bottom: 0; border-bottom: 0; font-size: 12px; } }
.copy { cursor: pointer; border: 0; background: none; color: var(--muted); padding: 0 4px; font-size: 13px; }
.copy:hover { color: var(--accent); }

.pager { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.pager a, .pager span { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink-2); }
.pager a:hover { text-decoration: none; background: var(--surface-2); }
.pager .dis { opacity: .4; pointer-events: none; }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 5px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 13px; }
.tabs a.on { background: var(--accent-soft); color: var(--accent-ink); }
.tabs a:hover { text-decoration: none; }

.chart { width: 100%; height: 220px; display: block; }
.chart .bar { fill: var(--bar); }
.chart .bar:hover, .chart .bar.hl { fill: var(--accent-ink); }
.chart .gl { stroke: var(--grid); }
.chart text { fill: var(--muted); font: 11px Inter, sans-serif; }
.chart .area { fill: var(--accent-soft); }
.chart .line { fill: none; stroke: var(--bar); stroke-width: 2; }
.tip { position: fixed; pointer-events: none; z-index: 50; background: var(--ink); color: var(--bg); padding: 7px 10px; border-radius: 8px; font-size: 12px; line-height: 1.4; box-shadow: 0 4px 16px rgba(0,0,0,.2); }

.hero-addr { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ident { width: 46px; height: 46px; border-radius: 50%; flex: none; }
.bal { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.bal small { font-size: 15px; color: var(--muted); font-weight: 600; }
.note { background: var(--accent-soft); color: var(--ink); border-radius: 12px; padding: 12px 16px; font-size: 13px; margin-bottom: 16px; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px; padding: 28px 16px 40px; }
.live { color: var(--muted); }
.live.on { color: var(--good); }
.sym { color: var(--muted); font-weight: 500; font-size: .9em; }

.logo-img { width: 34px; height: 34px; display: block; }

.lang-btn { font: 600 12px Inter, sans-serif; width: auto; padding: 0 10px; margin-left: auto; }
.lang-btn + .icon-btn { margin-left: 8px; }

/* wallet statement */
.stmt { background: linear-gradient(135deg, var(--accent-soft), var(--surface) 60%); }
.stmt-h { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-end; }
.stmt-h h2 { font-size: 17px; margin-bottom: 4px; }
.stmt-h p { margin: 0; max-width: 460px; font-size: 13px; }
.stmt-f { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.stmt-f label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.stmt-f input { height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 14px Inter, sans-serif; }
.btn-pdf { height: 40px; padding: 0 18px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #ff8a00, #f0300a); color: #fff; font: 600 14px Inter, sans-serif; cursor: pointer; }
.btn-pdf:hover { filter: brightness(1.05); }
.stmt-q { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 16px; }
.stmt-q button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: 5px 12px; font: 500 12.5px Inter, sans-serif; cursor: pointer; }
.stmt-q button:hover { border-color: var(--accent); color: var(--accent-ink); }
.stmt .err { margin-top: 10px; }

/* foundation */
.tag-f { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 12.5px; color: var(--accent-ink); background: var(--accent-soft); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.tag-f:hover { text-decoration: none; filter: brightness(.97); }
.pill.fnd { background: var(--accent-soft); color: var(--accent-ink); margin-left: 6px; text-transform: none; letter-spacing: 0; }
.fnd-card { background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); }
.fnd-card .k { color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.fnd-card .v { font-size: 26px; font-weight: 700; margin: 4px 0 6px; }
.fnd-card p { margin: 0; font-size: 13px; max-width: 760px; }

/* insights */
.ins-h { font-size: 20px; margin: 36px 0 14px; }
.stat .v.sm { font-size: 22px; }
.hbars { display: grid; gap: 10px; }
.hb { display: grid; grid-template-columns: 120px minmax(0, 1fr) 130px; gap: 12px; align-items: center; font-size: 13.5px; }
.hb-l { color: var(--ink-2); font-family: "JetBrains Mono", monospace; font-size: 12.5px; }
.hb-t { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hb-t span { display: block; height: 100%; background: var(--accent); border-radius: 99px; min-width: 2px; }
.hb-v { text-align: right; font-weight: 600; }
@media (max-width: 600px) { .hb { grid-template-columns: 90px minmax(0, 1fr) 90px; } }
.split { display: flex; height: 18px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--surface); }
.sp-f { background: var(--accent); }
.sp-c { flex: 1; background: #3b82c4; }
.split-l { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 12px; font-size: 14px; align-items: center; }
.split-l > span { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot.f { background: var(--accent); } .dot.c { background: #3b82c4; }
.card-h h2 small { font-weight: 500; font-size: 12.5px; margin-left: 6px; }
