:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #141a2b;
  --ink2: #49516a;
  --muted: #7a8199;
  --line: #e6e8f0;
  --accent: #3b5bfd;
  --accent-soft: #eef1ff;
  --good: #0f9d6b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 26, 43, .04), 0 8px 24px rgba(20, 26, 43, .06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
b { font-weight: 600; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
h1 { font-size: 34px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 12px; }
h2 { font-size: 20px; letter-spacing: -.01em; margin: 0 0 6px; }
h3 { font-size: 15px; margin: 18px 0 6px; }
a { color: var(--accent); }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.88); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700;
  font-size: 13px; letter-spacing: .02em; background: linear-gradient(135deg, #3b5bfd, #12b5a5); }
.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--muted); }
nav { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
nav a { color: var(--ink2); text-decoration: none; font-size: 13.5px; padding: 6px 10px; border-radius: 8px; }
nav a:hover { background: var(--accent-soft); color: var(--accent); }
nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* hero */
.hero { display: grid; grid-template-columns: 1.35fr 1fr; gap: 28px; align-items: center; padding: 36px 0 22px; }
.lead { font-size: 16.5px; color: var(--ink2); margin: 0 0 8px; max-width: 680px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.tile .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.tile .k { font-size: 12.5px; color: var(--muted); }

/* cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; margin: 0 0 22px; }
.card-head { margin-bottom: 14px; }
.card-head p { margin: 0; max-width: 900px; font-size: 14px; }
section { padding-top: 4px; }
.table-scroll { overflow-x: auto; }

/* leaderboard bars */
.lb { display: grid; grid-template-columns: 210px 1fr 70px; gap: 10px 14px; align-items: center; margin: 6px 0 18px; position: relative; }
.lb-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.lb-name .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lb-name .tag { font-weight: 500; font-size: 11px; color: var(--muted); }
.lb-track { position: relative; height: 26px; background: #f1f3f8; border-radius: 7px; overflow: visible; }
.lb-bar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; transition: width .6s ease; }
.lb-ref { position: absolute; top: -6px; bottom: -6px; border-left: 2px dashed #9aa1b8; }
.lb-ref span { position: absolute; top: -18px; left: 4px; white-space: nowrap; font-size: 11px; color: var(--muted); }
.lb-val { font-weight: 700; font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; }
.lb-pending { color: var(--muted); font-size: 12.5px; padding-left: 8px; line-height: 26px; }
.lb-axis { grid-column: 2; display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: -6px; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tbl th { text-align: right; font-weight: 600; color: var(--ink2); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap; cursor: default; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #fafbfe; }
.tbl .best { font-weight: 700; color: var(--good); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; }
.chip.done { background: #e7f7ef; color: #0b7a53; }
.chip.running { background: #fff4e0; color: #9a5b00; }
.chip.pending { background: #f0f1f5; color: #7a8199; }
.legend-notes { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }

/* takeaways */
.takeaways h2 { margin-bottom: 10px; }
.takeaways ul { margin: 0; padding-left: 20px; }
.takeaways li { margin: 6px 0; color: var(--ink2); }

/* heatmaps */
.heat { border-collapse: separate; border-spacing: 3px; font-size: 13px; width: 100%; font-variant-numeric: tabular-nums; }
.heat th { font-size: 12px; font-weight: 600; color: var(--ink2); padding: 4px 6px; text-align: center; white-space: nowrap; }
.heat th.rowh { text-align: left; }
.heat td { text-align: center; padding: 7px 4px; border-radius: 6px; min-width: 74px; }
.heat td.rowl { text-align: left; background: none; white-space: nowrap; padding-right: 12px; }
.heat td.rowl .n { color: var(--muted); font-size: 11.5px; margin-left: 6px; }
.heat td.ref { color: var(--ink2); background: #f4f5f9 !important; font-style: italic; }
.heat td.top { box-shadow: inset 0 0 0 2px rgba(15, 157, 107, .9); font-weight: 700; }

/* slices */
.slices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.slice { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.slice h4 { margin: 0 0 10px; font-size: 13.5px; }
.slice .grp { margin: 10px 0 4px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.sb { display: grid; grid-template-columns: 116px 1fr 46px; gap: 6px; align-items: center; margin: 3px 0; font-size: 12px; }
.sb .t { height: 12px; background: #f1f3f8; border-radius: 4px; position: relative; overflow: hidden; }
.sb .b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.sb .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink2); }
.sb .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink2); }

/* calibration */
.cal-wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 26px; align-items: start; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; margin-top: 8px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.cal-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }

/* head to head */
.h2h { border-collapse: separate; border-spacing: 3px; font-size: 13px; font-variant-numeric: tabular-nums; }
.h2h th { font-size: 12px; font-weight: 600; color: var(--ink2); padding: 4px 8px; white-space: nowrap; }
.h2h td { text-align: center; padding: 9px 8px; border-radius: 6px; min-width: 92px; }
.h2h td.self { background: #f4f5f9; color: var(--muted); }

/* question explorer */
.filters { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.filters input, .filters select { font: inherit; font-size: 13.5px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink); }
.filters input { flex: 1; min-width: 260px; }
.qtbl td.qt { white-space: normal; text-align: left; min-width: 380px; max-width: 560px; color: var(--ink); line-height: 1.4; }
.qtbl td.qt .qid { display: block; font-size: 11px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin-top: 2px; }
.qtbl td.cell { padding: 6px 4px; }
.qtbl td.cell span { display: inline-block; min-width: 48px; padding: 3px 0; border-radius: 6px; text-align: center; font-size: 12.5px; }
.fam-pill { display: inline-block; font-size: 11px; background: var(--accent-soft); color: var(--accent); padding: 1px 8px; border-radius: 99px; }

/* method */
.method { display: grid; grid-template-columns: 1.25fr 1fr; gap: 34px; font-size: 14px; color: var(--ink2); }
.method p { margin: 0 0 10px; }
.method ul { padding-left: 18px; margin: 0; }
.method li { margin: 6px 0; }
.mcard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.mcard .mh { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.mcard .mh .sw { width: 10px; height: 10px; border-radius: 3px; }
.mcard .meta { font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.mcard p { font-size: 13px; margin: 0; }

footer { padding: 10px 0 40px; text-align: center; }

/* tooltip */
.tip { position: fixed; pointer-events: none; z-index: 50; background: #141a2b; color: #fff; font-size: 12.5px; line-height: 1.45;
  padding: 8px 10px; border-radius: 8px; max-width: 320px; opacity: 0; transition: opacity .12s; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.tip.on { opacity: 1; }

@media (max-width: 980px) {
  .hero, .cal-wrap, .method { grid-template-columns: 1fr; }
  .slices { grid-template-columns: 1fr 1fr; }
  nav { display: none; }
  .lb { grid-template-columns: 150px 1fr 56px; }
}
@media (max-width: 640px) { .slices { grid-template-columns: 1fr; } h1 { font-size: 26px; } }
