@font-face { font-family: "Geist"; src: url("assets/fonts/geist/Geist-VariableFont_wght.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("assets/fonts/geist-mono/GeistMono-VariableFont_wght.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #000;
  --surface: #101010;
  --surface-2: #171717;
  --surface-3: #262626;
  --border: #2f2f2f;
  --border-strong: #404040;
  --text: #f5f7f7;
  --text-2: #c2c9c6;
  --muted: #8b9691;
  --subtle: #69726e;
  --brand: #00ffa3;
  --brand-hover: #00c07b;
  --error: #ff7b7b;
  --warning: #f5b84b;
  --radius: 8px;
  --radius-control: 4px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Geist", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif; }
body.no-scroll { overflow: hidden; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
[hidden] { display: none !important; }

.topbar { position: sticky; top: 0; z-index: 20; height: 68px; border-bottom: 1px solid var(--border); background: rgba(0, 0, 0, .94); backdrop-filter: blur(14px); }
.topbar-inner { width: min(1440px, calc(100% - 48px)); height: 100%; margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; }
.brand img { display: block; width: 154px; height: auto; }
.product-title { display: flex; gap: 8px; align-items: baseline; min-width: 0; color: var(--muted); font-size: 13px; }
.product-title strong { color: var(--text); font-weight: 600; }
.snapshot-state { min-height: 28px; display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-family: "Geist Mono", monospace; font-size: 11px; white-space: nowrap; }
.snapshot-state.ready { color: var(--brand); border-color: rgba(0, 255, 163, .35); }
.snapshot-state.error { color: var(--error); border-color: rgba(255, 123, 123, .4); }

.shell { width: min(1440px, calc(100% - 180px)); margin: 0 auto; padding: 54px 0 32px; }
.intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr); align-items: end; gap: 48px; margin-bottom: 32px; }
.eyebrow { margin: 0 0 12px; color: var(--brand); font-family: "Geist Mono", monospace; font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 12px; font-size: clamp(34px, 4.4vw, 62px); line-height: 1.02; letter-spacing: -.045em; }
.intro-copy { max-width: 690px; margin-bottom: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.source-lockup { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-top: 1px solid var(--border-strong); }
.source-lockup span, .source-lockup b { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.source-lockup span { color: var(--muted); }
.source-lockup b { color: var(--text-2); font-family: "Geist Mono", monospace; font-weight: 500; text-align: right; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
.coverage-panel .metric-grid { margin: 0; border: 0; border-radius: 0; }
.metric { min-width: 0; padding: 18px 20px; background: var(--surface); border-right: 1px solid var(--border); }
.metric:last-child { border-right: 0; }
.metric span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; }
.metric strong { display: block; font-family: "Geist Mono", monospace; font-size: clamp(22px, 2.5vw, 34px); font-weight: 560; font-variant-numeric: tabular-nums; }
.metric small { display: block; margin-top: 6px; color: var(--subtle); font-size: 10px; }
.metric-skeleton, .radar-skeleton { min-height: 102px; background: linear-gradient(90deg, var(--surface) 20%, var(--surface-2) 50%, var(--surface) 80%); background-size: 220% 100%; }

.panel { margin-bottom: 24px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.panel-head h2 { margin-bottom: 6px; font-size: 19px; letter-spacing: -.02em; }
.panel-head p { margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.panel-tools { display: grid; justify-items: end; gap: 10px; }
.endpoint-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.endpoint-link { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid #3f83ff; border-radius: var(--radius-control); color: #d7e6ff; background: rgba(63, 131, 255, .08); font-size: 10px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap; transition: border-color 140ms ease, background 140ms ease, color 140ms ease; }
.endpoint-link:hover { border-color: #76a7ff; background: rgba(63, 131, 255, .16); color: #fff; }
.toolbar { display: flex; align-items: flex-end; gap: 10px; }
.search-field, .select-field { display: grid; gap: 6px; }
.search-field span, .select-field span { color: var(--muted); font-size: 10px; }
.search-field input, .select-field select { height: 40px; border: 1px solid var(--border-strong); border-radius: var(--radius-control); background: var(--surface-2); color: var(--text); padding: 0 12px; }
.search-field input { width: 260px; }
.search-field input::placeholder { color: #78827d; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 1120px; border-collapse: collapse; }
th { padding: 0 14px; height: 42px; background: var(--surface-2); color: var(--muted); text-align: left; font-size: 10px; font-weight: 500; white-space: nowrap; }
th.numeric, td.numeric { text-align: right; }
th button { width: 100%; height: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: inherit; cursor: pointer; }
th[aria-sort="ascending"] button::after { content: "  ↑"; color: var(--brand); }
th[aria-sort="descending"] button::after { content: "  ↓"; color: var(--brand); }
td { padding: 12px 14px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 12px; vertical-align: middle; }
tbody tr { cursor: pointer; transition: background 140ms ease; }
tbody tr:hover, tbody tr:focus-visible { background: #161b19; }
.rank-cell { color: var(--muted); font-family: "Geist Mono", monospace; }
.identity { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.avatar { position: relative; width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--surface-3); color: var(--brand); font-size: 11px; font-weight: 700; }
.avatar.large { width: 44px; height: 44px; }
.avatar-fallback { grid-area: 1 / 1; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.identity b { display: block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 13px; font-weight: 600; }
.identity small { display: block; margin-top: 3px; color: var(--muted); font-family: "Geist Mono", monospace; }
.money { color: var(--text); font-family: "Geist Mono", monospace; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.positive { color: var(--brand); }
.money.negative { color: var(--error); }
.snapshot-note { display: block; margin-top: 4px; color: var(--muted); font-family: "Geist Mono", monospace; font-size: 8px; white-space: nowrap; }
.status-label { display: inline-flex; min-height: 24px; align-items: center; padding: 3px 8px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.status-label.ready { color: var(--brand); border-color: rgba(0, 255, 163, .34); }
.status-label.partial { color: var(--warning); border-color: rgba(245, 184, 75, .36); }
.token-cell { display: flex; justify-content: flex-end; align-items: center; gap: 7px; min-width: 120px; }
.token-logo { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-3); color: var(--brand); font-family: "Geist", "PingFang SC", system-ui, sans-serif; font-size: 9px; font-weight: 700; text-decoration: none; }
.token-logo-fallback, .token-logo img { grid-area: 1 / 1; }
.token-logo img { z-index: 1; width: 100%; height: 100%; object-fit: cover; background: var(--surface-3); }
.token-cell b { color: var(--text); }
.token-cell small { display: block; margin-top: 2px; color: var(--muted); font-family: "Geist Mono", monospace; }
.buy-cell b { display: flex; align-items: baseline; gap: 6px; color: var(--text); }
.buy-cell small { display: block; margin-top: 3px; color: var(--muted); font-family: "Geist Mono", monospace; }
.empty-state { padding: 54px 20px; text-align: center; }
.empty-state strong, .empty-state span { display: block; }
.empty-state span { margin-top: 8px; color: var(--muted); font-size: 12px; }

.compact-head { align-items: center; }
.source-chip { min-height: 28px; display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--muted); font-family: "Geist Mono", monospace; font-size: 10px; }
.source-chip.snapshot { color: var(--text-2); }
.source-chip.refreshing { color: var(--brand); }
.source-chip.error { color: #e6b968; }
.radar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.radar-card { min-width: 0; padding: 16px; border-right: 1px solid var(--border); border-top: 1px solid var(--border); background: transparent; cursor: pointer; }
.radar-card:nth-child(-n+4) { border-top: 0; }
.radar-card:nth-child(4n) { border-right: 0; }
.radar-card:hover, .radar-card:focus-visible { background: #161b19; }
.radar-token { display: flex; align-items: center; gap: 9px; }
.radar-token b { color: var(--text); }
.radar-token span { margin-left: auto; color: var(--muted); font-family: "Geist Mono", monospace; font-size: 10px; }
.radar-card p { margin: 12px 0 0; overflow: hidden; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.radar-card small { display: block; margin-top: 5px; color: var(--muted); font-family: "Geist Mono", monospace; }

.method-panel { margin-bottom: 32px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.method-panel summary { padding: 16px 20px; cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 600; }
.method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border-top: 1px solid var(--border); background: var(--border); }
.method-grid > div { padding: 18px 20px; background: var(--surface); }
.method-grid span { color: var(--brand); font-family: "Geist Mono", monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.method-grid p { max-width: 58ch; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.footer { width: min(1440px, calc(100% - 180px)); margin: 0 auto; padding: 0 0 32px; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 11px; }
.footer a { color: var(--brand); }

.drawer-layer { position: fixed; inset: 0; z-index: 60; }
.drawer-scrim { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(0, 0, 0, .72); cursor: default; }
.drawer { position: absolute; inset: 0 0 0 auto; width: min(680px, 96vw); display: flex; flex-direction: column; border-left: 1px solid var(--border-strong); background: var(--surface); animation: drawer-in 180ms cubic-bezier(.16, 1, .3, 1); }
@keyframes drawer-in { from { transform: translateX(28px); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.drawer-identity > div:last-child { min-width: 0; }
.drawer-identity span { color: var(--brand); font-family: "Geist Mono", monospace; font-size: 10px; }
.drawer-identity h2 { margin: 3px 0 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
.drawer-identity p { margin: 0; color: var(--muted); font-family: "Geist Mono", monospace; font-size: 11px; }
.button { min-height: 40px; padding: 0 13px; border-radius: var(--radius-control); cursor: pointer; font-size: 12px; font-weight: 600; }
.button.secondary { border: 1px solid var(--border-strong); background: var(--surface-3); color: var(--text); }
.button.secondary:hover { border-color: var(--brand-hover); }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.drawer-status { min-height: 38px; display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--border); color: var(--muted); font-family: "Geist Mono", monospace; font-size: 10px; }
.drawer-status.live { color: var(--brand); }
.drawer-status.error { color: var(--error); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; }
.drawer-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.drawer-metric { min-width: 0; padding: 13px; border-right: 1px solid var(--border); background: var(--surface-2); }
.drawer-metric:last-child { border-right: 0; }
.drawer-metric span { display: block; color: var(--muted); font-size: 9px; }
.drawer-metric strong { display: block; margin-top: 7px; overflow: hidden; text-overflow: ellipsis; color: var(--text); font-family: "Geist Mono", monospace; font-size: 16px; font-variant-numeric: tabular-nums; }
.wallet-addresses { display: grid; gap: 8px; margin-top: 12px; }
.address-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-control); }
.fomo-profile-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-control); }
.address-row span, .fomo-profile-row > span { color: var(--muted); font-size: 10px; }
.address-row code, .fomo-profile-row code { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); font-family: "Geist Mono", monospace; font-size: 10px; white-space: nowrap; }
.quiet-action { min-height: 30px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-control); background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; text-decoration: none; display: inline-flex; align-items: center; }
.quiet-action:hover { color: var(--brand); border-color: var(--brand-hover); }
.drawer-section { margin-top: 22px; }
.drawer-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.drawer-section-head .endpoint-actions { flex: 0 0 auto; }
.drawer-section h3 { margin: 0; font-size: 13px; }
.drawer-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.drawer-table { width: 100%; min-width: 590px; }
.drawer-table th { height: 34px; padding: 0 10px; font-size: 9px; }
.drawer-table td { padding: 10px; font-size: 11px; }
.drawer-table .token-id { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.drawer-table .token-id:hover b { color: var(--brand); }
.token-name { min-width: 0; display: inline-flex; align-items: baseline; gap: 6px; color: var(--text); font-family: "Geist", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif; font-weight: 650; text-decoration: none; }
.token-name b { color: var(--text); font-family: inherit; font-weight: 650; letter-spacing: -.01em; text-decoration: none; }
.chain-tag { display: inline-flex; flex: 0 0 auto; color: var(--muted); font-family: "Geist Mono", monospace; font-size: 8px; font-weight: 500; letter-spacing: .05em; line-height: 1; text-decoration: none; text-transform: uppercase; }
.coverage-note { margin: 9px 0 0; padding: 10px; border-left: 2px solid var(--warning); background: #1d1a12; color: #d8c395; font-size: 10px; line-height: 1.55; }
.portfolio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.portfolio-block { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.portfolio-block-head { padding: 11px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.portfolio-block-head div { display: flex; justify-content: space-between; gap: 10px; }
.portfolio-block-head b { color: var(--text); font-size: 12px; }
.portfolio-block-head strong { color: var(--brand); font-family: "Geist Mono", monospace; font-size: 12px; }
.portfolio-block-head p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.holding-list { max-height: 290px; overflow-y: auto; }
.holding-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border); color: inherit; text-decoration: none; transition: background 120ms ease; }
.holding-row:first-child { border-top: 0; }
.holding-row[href]:hover { background: var(--surface-2); }
.holding-row[href]:hover b { color: var(--brand); }
.holding-main { min-width: 0; display: flex; align-items: center; gap: 9px; }
.holding-main > div { min-width: 0; }
.holding-row b { display: block; color: var(--text-2); font-size: 11px; }
.holding-row small { display: block; margin-top: 3px; color: var(--muted); font-family: "Geist Mono", monospace; font-size: 9px; }
.holding-row strong { align-self: center; color: var(--text); font-family: "Geist Mono", monospace; font-size: 10px; }
.empty-mini { padding: 18px 12px; color: var(--muted); font-size: 10px; }
.buy-list { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.buy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 11px 12px; background: var(--surface-2); }
.buy-token { min-width: 0; display: flex; align-items: center; gap: 9px; }
.buy-token > div { min-width: 0; }
.buy-row b { color: var(--text); font-size: 11px; }
.buy-row small { display: block; margin-top: 3px; color: var(--muted); font-family: "Geist Mono", monospace; font-size: 9px; }
.buy-market { min-width: 74px; color: var(--text-2); text-align: right; }
.buy-market small { margin: 0 0 2px; font-family: "Geist", sans-serif; font-size: 8px; text-transform: uppercase; letter-spacing: .04em; }
.buy-market strong { font-family: "Geist Mono", monospace; font-size: 10px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 80; max-width: min(360px, calc(100% - 36px)); padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-control); background: var(--surface-3); color: var(--text); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 150ms ease, transform 150ms ease; font-size: 11px; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1120px) {
  .shell, .footer { width: min(100% - 48px, 1440px); }
  .intro { grid-template-columns: 1fr; gap: 24px; }
  .source-lockup { max-width: 620px; }
  .radar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .radar-card:nth-child(-n+4), .radar-card:nth-child(4n) { border-top: 1px solid var(--border); border-right: 1px solid var(--border); }
  .radar-card:nth-child(-n+3) { border-top: 0; }
  .radar-card:nth-child(3n) { border-right: 0; }
}

@media (max-width: 760px) {
  .topbar-inner, .shell, .footer { width: calc(100% - 28px); }
  .topbar-inner { grid-template-columns: auto 1fr; gap: 12px; }
  .product-title { display: none; }
  .snapshot-state { justify-self: end; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
  .shell { padding-top: 32px; }
  h1 { font-size: 38px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { border-bottom: 1px solid var(--border); }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-last-child(-n+2) { border-bottom: 0; }
  .panel-head { align-items: stretch; flex-direction: column; }
  .panel-tools { justify-items: stretch; }
  .endpoint-actions { justify-content: flex-start; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-field input { width: 100%; }
  .radar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .radar-card:nth-child(-n+3), .radar-card:nth-child(3n) { border-top: 1px solid var(--border); border-right: 1px solid var(--border); }
  .radar-card:nth-child(-n+2) { border-top: 0; }
  .radar-card:nth-child(2n) { border-right: 0; }
  .method-grid, .portfolio-grid { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
  .drawer-metrics { grid-template-columns: 1fr; }
  .drawer-metric { border-right: 0; border-bottom: 1px solid var(--border); }
  .drawer-metric:last-child { border-bottom: 0; }
  .drawer-section-head { align-items: flex-start; flex-direction: column; }
  .address-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .address-row a { display: none; }
  .footer { flex-direction: column; }
}

@media (max-width: 420px) {
  .brand img { width: 128px; }
  .metric { padding: 15px; }
  .radar-grid { grid-template-columns: 1fr; }
  .radar-card, .radar-card:nth-child(-n+2), .radar-card:nth-child(2n) { border-right: 0; border-top: 1px solid var(--border); }
  .radar-card:first-child { border-top: 0; }
  .drawer-head { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (prefers-reduced-motion: no-preference) {
  .metric-skeleton, .radar-skeleton { animation: shimmer 1.4s ease-in-out infinite; }
  @keyframes shimmer { to { background-position: -220% 0; } }
}
