:root {
  --paper: #f7f5f0;
  --paper-2: #efece4;
  --ink: #111111;
  --ink-2: #4a4845;
  --ink-3: #8a877f;
  --line: #ddd8cc;
  --mint: #10a37f;
  --mint-soft: #dff3ec;
  --clay: #c96f4a;
  --clay-soft: #f6e4dc;
  --display: "Inter Tight", "IBM Plex Sans", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
}
a { color: inherit; }
button, select { font: inherit; color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.top { border-bottom: 1px solid var(--line); padding: 22px 0 14px; background: var(--paper); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: -0.02em; margin: 0; }
.tag { margin: 8px 0 14px; color: var(--ink-2); max-width: 720px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 6px 12px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--ink); }
.seg button.on { background: var(--ink); color: var(--paper); }
.sort { color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.sort select { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 8px; }
.updated { color: var(--ink-3); font-size: 13px; margin-left: auto; }

main { padding: 18px 16px 30px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tile b { display: block; font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.tile span { color: var(--ink-2); font-size: 13px; }
.tile.clay b { color: var(--clay); }
.tile.mint b { color: var(--mint); }

.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.card h2 { font-family: var(--display); font-size: 20px; letter-spacing: -0.015em; margin: 0 0 10px; }
.leaders .lead-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.lead { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.lead:hover { border-color: var(--ink); }
.lead .n { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--mint); }
.lead > span:last-child { min-width: 0; display: block; }
.lead .t { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead .s { display: block; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead .t .s { display: inline; }
.tiles .tile, .company, .card { min-width: 0; }
.qhead > *, .qmeta > * { min-width: 0; max-width: 100%; }
.qmeta span, .issuer { overflow-wrap: anywhere; }

.company { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 16px; overflow: hidden; }
.company > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.company h2 { font-family: var(--display); font-size: 24px; letter-spacing: -0.02em; margin: 0; }
.cstats { color: var(--ink-2); font-size: 13.5px; }
.company .empty { padding: 12px 16px; color: var(--ink-3); }

.quote { padding: 12px 16px 14px; border-top: 1px solid var(--line); }
.quote:first-of-type { border-top: 0; }
.qhead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.badge.verified { background: var(--mint-soft); color: #0a6e55; }
.badge.other { background: var(--clay-soft); color: #8d4426; }
.chainp { font-size: 12px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.qsym { font-family: var(--display); font-weight: 700; font-size: 18px; }
.qname { color: var(--ink-2); }
.price { font-family: var(--display); font-weight: 600; font-size: 18px; margin-left: auto; white-space: nowrap; }
.price em { font-style: normal; font-size: 13px; font-weight: 500; margin-left: 6px; }
.up { color: var(--mint); } .down { color: var(--clay); }
.qmeta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); font-size: 13px; margin-top: 6px; align-items: center; }
.addr { font-family: var(--mono); font-size: 12.5px; background: var(--paper-2); padding: 2px 6px; border-radius: 6px; }
.copy { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 2px 8px; font-size: 12px; cursor: pointer; }
.copy:hover { border-color: var(--ink); }
.qstats { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.qstats b { color: var(--ink); font-weight: 600; }
.issuer { font-size: 13px; color: var(--ink-2); }
.issuer.warn { color: #8d4426; }

.tbl { overflow-x: auto; margin-top: 10px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; min-width: 760px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { color: var(--ink-3); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.rank { color: var(--ink-3); width: 30px; }
td.coin { white-space: normal; min-width: 200px; }
.coin .nm { display: flex; align-items: center; gap: 8px; }
.logo { width: 22px; height: 22px; border-radius: 6px; background: var(--paper-2); object-fit: cover; flex: 0 0 22px; }
.logo.ph { display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.coin .sym { font-weight: 600; }
.coin .full { color: var(--ink-2); font-size: 12.5px; display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tagp { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); margin-left: 4px; }
.tagp.grad { background: var(--mint-soft); color: #0a6e55; }
.tagp.flag { background: var(--clay-soft); color: #8d4426; }
tr.flagged td { color: var(--ink-3); }
tr.flagged .sym { text-decoration: line-through; }
.links a { color: var(--ink-2); text-decoration: none; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 12px; margin-right: 4px; }
.links a:hover { border-color: var(--ink); color: var(--ink); }
.more { margin-top: 8px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 13px; }
.more:hover { border-color: var(--ink); }
.none { color: var(--ink-3); font-size: 13.5px; margin-top: 6px; }

.others { padding: 10px 16px 14px; border-top: 1px solid var(--line); background: var(--paper); }
.others summary { cursor: pointer; font-weight: 600; color: #8d4426; }
.others summary span { color: var(--ink-2); font-weight: 400; }
.others ul { margin: 8px 0 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.others li { font-size: 13.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.others li b { color: var(--ink); }
.others .quote { padding: 10px 0 0; border-top: 0; }

.rules ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.rules li { margin: 6px 0; }
.foot { color: var(--ink-3); font-size: 13px; padding-bottom: 30px; }

@media (max-width: 640px) {
  .brand h1 { font-size: 24px; }
  .updated { margin-left: 0; width: 100%; }
  .price { margin-left: 0; width: 100%; }
  .company > header { padding: 12px 14px 8px; }
  .quote, .others { padding-left: 14px; padding-right: 14px; }
}
