:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1c2128;
  --muted: #5c6773;
  --line: #d8dee6;
  --accent: #0f5c8c;
  --accent-soft: #e7f2f8;
  --danger: #9f2d2d;
  --warn: #8a5a12;
  --font: "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
}

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

h1, h2, h3 { font-weight: 600; letter-spacing: 0; }
h1 { font-size: 28px; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 28px 0 10px; }
#token-title { margin: 0; }
h3 { font-size: 16px; margin: 0 0 10px; }

p { margin: 0 0 8px; }
.meta { color: var(--muted); font-size: 13px; }

.page-head { margin-bottom: 8px; }

.page-nav { display: flex; gap: 16px; margin-top: 12px; }
.page-nav a { color: var(--accent); }

#explorer { margin-top: 12px; }
#explorer > h2 { margin-top: 36px; }

.verdicts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  margin: 14px 0 18px;
}
.verdict {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.verdict b { display: block; margin-bottom: 4px; }
.verdict span { color: var(--muted); font-size: 13px; }

.chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0 16px;
}
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0; padding: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }

#report .table-wrap { margin: 8px 0 16px; }
#report td.num { text-align: right; }
tr.peak td { background: var(--accent-soft); }
.notes { margin: 8px 0 0; padding-left: 18px; }
.notes li { margin: 4px 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

.filters, #detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}

#detail { margin-top: 16px; }

.pills, .controls, .title-row, .stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pills { margin-bottom: 10px; }
.title-row { justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.title-row .pills { margin: 0; }

.pill, button, select, input {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
}

.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button { cursor: pointer; }
button:disabled { opacity: 0.4; cursor: default; }

input, select { border-radius: 8px; }
input { width: 180px; }
select { min-width: 280px; max-width: 100%; }

.check {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.stats { margin: 8px 0 12px; }
.stat {
  min-width: 140px;
  padding: 8px 0;
}
.stat b {
  display: block;
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stat span { color: var(--muted); font-size: 12px; }
.stat.danger b { color: var(--danger); }
.stat.warn b { color: var(--warn); }

.chart-wrap { position: relative; margin-top: 8px; }
#chart { width: 100%; height: auto; display: block; }
.tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--text);
  color: #fff;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.table-wrap { overflow: auto; max-height: 420px; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { position: sticky; top: 0; background: #f7f9fb; font-size: 12px; color: var(--muted); font-weight: 600; }
td:nth-child(1), td:nth-child(3), td:nth-child(4),
th:nth-child(1), th:nth-child(3), th:nth-child(4) { text-align: right; }
tr.partial td { background: #fbf6ec; }

#empty { margin-top: 16px; }
