:root {
  --bg: #ffffff;
  --bg2: #f5f7fa;
  --line: #e8ebf0;
  --text: #0a0b0d;
  --muted: #5b616e;
  --up: #098551;
  --down: #cf202f;
  --accent: #1652f0;
  --chip: #eef0f3;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0b0d; --bg2: #14161a; --line: #23262d; --text: #f2f4f7; --muted: #8a919e;
    --up: #27ad75; --down: #f0616d; --accent: #578bfa; --chip: #1c1f25;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }
.num { text-align: right; }

.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
  padding: 12px max(16px, calc((100vw - 1200px) / 2)); background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.logo { flex: none; font-weight: 700; font-size: 19px; letter-spacing: -.3px; white-space: nowrap; }
.logo { display: inline-flex; align-items: center; gap: 7px; }
.logo-mark { width: 22px; height: 22px; flex: none; }
.search { position: relative; margin-left: auto; width: min(360px, 100%); }
.search input {
  width: 100%; padding: 9px 14px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); font: inherit; outline: none;
}
.search input:focus { border-color: var(--accent); }
.search-res {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 12px 32px rgba(0,0,0,.15);
}
.search-res button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 14px; border: 0; background: none; text-align: left; }
.search-res button:hover, .search-res button.hl { background: var(--bg2); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px 40px; }
.hero { padding: 28px 0 12px; }
.hero h1 { margin: 0; font-size: 30px; letter-spacing: -.6px; }
.hero p { margin: 4px 0 12px; }
.global { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 13px; color: var(--muted); }
.global b { color: var(--text); font-weight: 600; margin-left: 4px; }

.cats { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 16px; scrollbar-width: none; }
.cats button {
  flex: none; display: flex; gap: 6px; align-items: baseline; padding: 8px 14px; border-radius: 99px;
  border: 0; background: var(--chip); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.cats button small { font-weight: 500; font-size: 12px; }
.cats button.on { background: var(--text); color: var(--bg); }
.cats button.on small { color: inherit; opacity: .8; }

.err { margin-bottom: 12px; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--down) 12%, transparent); color: var(--down); }

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 13px; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.num { text-align: right; }
.tbl td { padding: 14px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--bg2); }
.tbl .rank { color: var(--muted); font-size: 13px; }
.coin { display: flex; align-items: center; gap: 10px; }
.coin img, .coin .ph { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.coin .ph { display: inline-block; background: var(--chip); }
.coin b { font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.coin span { color: var(--muted); font-size: 13px; }
.star { border: 0; background: none; color: var(--line); font-size: 16px; padding: 0 2px; }
.star.on, .star:hover { color: #f5a623; }
.spark { width: 120px; height: 36px; display: block; }
.buy { padding: 7px 16px; border-radius: 99px; border: 0; background: var(--accent); color: #fff; font-weight: 600; font-size: 13px; }
.buy:hover { filter: brightness(1.1); }
.more { display: block; margin: 20px auto 0; padding: 10px 28px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); font-weight: 600; }
.more:hover { background: var(--bg2); }
.note { color: var(--muted); padding: 24px 12px; text-align: center; }

/* coin sheet */
.sheet {
  width: min(560px, 100vw); max-height: 92vh; padding: 24px; border: 0; border-radius: 20px;
  background: var(--bg); color: var(--text); box-shadow: 0 24px 64px rgba(0,0,0,.3);
}
.sheet::backdrop { background: rgba(0,0,0,.45); }
.x { position: absolute; top: 14px; right: 14px; border: 0; background: var(--chip); border-radius: 50%; width: 32px; height: 32px; }
.c-head { display: flex; align-items: center; gap: 12px; padding-right: 40px; }
.c-head img { width: 40px; height: 40px; border-radius: 50%; }
.c-head h2 { margin: 0; font-size: 20px; }
.c-price { font-size: 32px; font-weight: 700; letter-spacing: -.5px; margin-top: 14px; }
.c-chg { font-weight: 600; margin-left: 8px; font-size: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tags span { padding: 2px 10px; border-radius: 99px; background: var(--chip); font-size: 12px; color: var(--muted); }
.big { width: 100%; height: 140px; display: block; margin: 14px 0 4px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin: 16px 0; }
.stats dt { color: var(--muted); font-size: 13px; }
.stats dd { margin: 0; font-weight: 600; }
.sheet h3 { font-size: 16px; margin: 20px 0 8px; }
.ex { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ex img { width: 24px; height: 24px; border-radius: 6px; }
.ex div { flex: 1; }
.ex small { display: block; color: var(--muted); font-size: 12px; }
.warn { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, #f5a623 14%, transparent); font-size: 13px; margin: 8px 0; }
.addr { font: 12px/1.4 ui-monospace, Consolas, monospace; word-break: break-all; color: var(--muted); }
.copy { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 2px 8px; font-size: 12px; margin-left: 6px; }

.foot { max-width: 1200px; margin: 0 auto; padding: 24px 16px 40px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); }
.foot p { margin: 4px 0; }
.foot a { text-decoration: underline; }

@media (max-width: 900px) { .hide-md { display: none; } }
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .hero h1 { font-size: 24px; }
  .tbl td { padding: 12px 6px; }
  .tbl th { padding: 10px 6px; }
  .coin b { max-width: 110px; }
  .sheet { max-height: 88vh; margin: auto auto 0; border-radius: 20px 20px 0 0; padding: 20px 16px; }
}
.tv summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; margin-top: 10px; }
.tv iframe { width: 100%; height: 380px; border: 0; border-radius: 12px; margin-top: 8px; }
.doc { max-width: 720px; padding-top: 28px; }
.doc h1 { font-size: 30px; letter-spacing: -.6px; margin: 0 0 12px; }
.doc h2 { font-size: 18px; margin: 24px 0 6px; }
.doc a { color: var(--accent); }
.nav { display: flex; gap: 18px; font-weight: 500; font-size: 14px; color: var(--muted); }
.nav a:hover { color: var(--text); }
.doc.wide { max-width: 960px; }
.doc .tbl a.coin { color: inherit; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--chip); }
@media (max-width: 760px) { .top { flex-wrap: wrap; row-gap: 8px; } .top .nav { order: 3; width: 100%; } }
.steps { list-style: none; padding: 0; margin: 8px 0; }
.step { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.step .n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.step div { flex: 1; }
.step small { display: block; color: var(--muted); font-size: 12.5px; }
.step .buy { flex: none; }
.more-dex summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; margin: 10px 0 4px; }
.ramp { display: flex; gap: 6px; margin-top: 8px; }
.ramp input { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: 12px ui-monospace, Consolas, monospace; }
.ramp input:focus { outline: none; border-color: var(--accent); }
.ramp .buy:disabled { opacity: .6; }
.step small a { color: var(--accent); text-decoration: underline; }
.step small.ramp-err { color: var(--down); margin-top: 4px; }
/* guides */
.guide h1 { font-size: 32px; letter-spacing: -.6px; line-height: 1.2; margin: 6px 0 16px; }
.guide h2 { font-size: 21px; margin: 28px 0 8px; }
.guide p, .guide li { font-size: 16.5px; line-height: 1.7; }
.guide li { margin: 6px 0; }
.hero-img { margin: 0 0 20px; }
.hero-img img { width: 100%; height: auto; border-radius: 14px; display: block; background: var(--chip); }
.hero-img figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }
.hero-img figcaption a { text-decoration: underline; }
.guide-card { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; padding: 18px 0; border-top: 1px solid var(--line); }
.guide-card img { width: 100%; height: auto; border-radius: 10px; display: block; background: var(--chip); }
.guide-card h2 { margin: 0 0 6px; font-size: 19px; }
.guide-card p { margin: 0 0 4px; }
@media (max-width: 640px) { .guide-card { grid-template-columns: 1fr; } .guide h1 { font-size: 26px; } }

/* guide building blocks: summary box, flow, numbered steps, callouts, inline photos */
.guide .box { border: 1px solid var(--line); background: var(--bg2); border-radius: 14px; padding: 14px 18px; margin: 18px 0; }
.guide .box h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.guide .box ul { margin: 0; padding-left: 20px; }
.guide .box p { margin: 0; }
.guide .flow { list-style: none; padding: 0; margin: 18px 0; display: flex; flex-wrap: wrap; gap: 8px; counter-reset: f; }
.guide .flow li { flex: 1 1 140px; margin: 0; position: relative; padding: 12px 14px 12px 44px; border-radius: 12px; background: var(--chip); font-weight: 600; font-size: 15px; line-height: 1.35; counter-increment: f; }
.guide .flow li::before { content: counter(f); position: absolute; left: 12px; top: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; display: grid; place-items: center; }
.guide .flow li small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.guide .steps { list-style: none; padding: 0; counter-reset: s; }
.guide .steps > li { position: relative; padding: 0 0 6px 48px; margin: 18px 0; counter-increment: s; }
.guide .steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--text); color: var(--bg); font-weight: 700; display: grid; place-items: center; font-size: 15px; }
.guide .steps > li > b:first-child { display: block; font-size: 17px; }
.guide .tip, .guide .warn { border-radius: 12px; padding: 12px 16px; margin: 16px 0; }
.guide .tip { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.guide .warn { background: color-mix(in srgb, var(--down) 10%, transparent); }
.guide .tip::before { content: "Tip: "; font-weight: 700; color: var(--accent); }
.guide .warn::before { content: "Careful: "; font-weight: 700; color: var(--down); }
.guide .photo { margin: 20px 0; }
.guide .photo img { width: 100%; height: auto; border-radius: 12px; display: block; background: var(--chip); }
.guide .photo figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.guide .photo figcaption a { text-decoration: underline; }
