:root {
  --bg: #08111f;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe3ef;
  --blue: #2563eb;
  --green: #16a34a;
  --amber: #f59e0b;
  --red: #ef4444;
  --shadow: 0 24px 70px rgba(2, 6, 23, .22);
  --radius: 26px;
  --safe: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: linear-gradient(180deg, #07111f 0, #172554 900px, #eef4ff 901px, #f8fafc 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.38;
}
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }
button, .button {
  font: inherit;
  border: 0;
  border-radius: 999px;
  padding: .78rem 1rem;
  font-weight: 900;
  cursor: pointer;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .14);
}
button:hover, .button:hover { transform: translateY(-1px); text-decoration: none; }
.ghost { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.28); box-shadow: none; }
.hero { max-width: 1180px; margin: 0 auto; color: #fff; padding: 22px clamp(14px, 4vw, 42px) 28px; }
.topbar { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 54px; }
.topbar a { color: #dbeafe; font-weight: 900; border: 1px solid rgba(219,234,254,.24); border-radius: 999px; padding: .52rem .75rem; background: rgba(255,255,255,.08); }
.eyebrow { margin: .2rem 0 .5rem; text-transform: uppercase; letter-spacing: .15em; font-size: .74rem; font-weight: 950; color: #60a5fa; }
.hero h1 { font-size: clamp(2.55rem, 9vw, 6.9rem); line-height: .86; letter-spacing: -.07em; margin: .1rem 0 1rem; max-width: 1060px; }
.lede { max-width: 760px; color: #dbeafe; font-size: clamp(1rem, 2.2vw, 1.25rem); margin: 0 0 1.2rem; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0 18px; }
.lookup-panel { max-width: 980px; background: rgba(15,23,42,.66); border: 1px solid rgba(219,234,254,.24); border-radius: 22px; padding: 13px; box-shadow: 0 18px 40px rgba(0,0,0,.18); }
.lookup-panel label { display: block; color: #bfdbfe; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 950; margin-bottom: 8px; }
.lookup-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.lookup-row input { width: 100%; border: 1px solid rgba(219,234,254,.35); border-radius: 999px; padding: .82rem 1rem; font: inherit; font-weight: 850; color: #0f172a; background: #fff; box-shadow: inset 0 1px 0 rgba(15,23,42,.04); }
.lookup-row input:focus { outline: 3px solid rgba(96,165,250,.35); border-color: #93c5fd; }
.lookup-panel p { margin: 8px 0 0; color: #dbeafe; font-size: .9rem; font-weight: 700; }
.stat { background: rgba(15,23,42,.68); border: 1px solid rgba(219,234,254,.22); border-radius: 20px; padding: 14px; box-shadow: 0 18px 40px rgba(0,0,0,.2); }
.stat span { display: block; color: #bfdbfe; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 950; }
.stat strong { display: block; font-size: clamp(1.15rem, 4vw, 2.2rem); line-height: 1; margin: .28rem 0; }
.stat small { display: block; color: #dbeafe; font-weight: 750; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(14px, 4vw, 42px) 42px; }
.panel, .event-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.intro { padding: 18px; margin-top: 8px; display: grid; grid-template-columns: 1fr 1.25fr; gap: 18px; align-items: center; }
.intro h2, .section-head h2, .explain h2 { font-size: clamp(1.4rem, 4vw, 2.4rem); line-height: 1; margin: .2rem 0 .6rem; letter-spacing: -.03em; }
.intro p, .section-head p, .explain p { color: #475569; margin: .25rem 0; }
.activity-list { display: grid; gap: 8px; margin-top: 14px; }
.activity-list div { display: flex; justify-content: space-between; gap: 10px; padding: .72rem .85rem; background: #f8fafc; border: 1px solid var(--line); border-radius: 16px; font-weight: 850; }
.activity-list span { color: #64748b; font-weight: 800; }
.activity-chart {
  min-height: 315px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  grid-template-rows: 22px minmax(230px, 1fr) 26px;
  gap: 0 10px;
  padding: 12px 12px 8px;
  background: linear-gradient(180deg, #f8fbff, #eef6ff);
  border: 1px solid var(--line);
  border-radius: 22px;
}
.activity-y-title { grid-column: 1 / 3; color: #64748b; font-size: .72rem; font-weight: 950; text-transform: uppercase; letter-spacing: .12em; }
.activity-y-axis { grid-row: 2; position: relative; border-right: 1px solid #cbd5e1; }
.activity-y-axis span { position: absolute; right: 8px; transform: translateY(50%); color: #64748b; font-size: .72rem; font-weight: 900; }
.activity-plot { grid-row: 2; grid-column: 2; position: relative; min-height: 230px; }
.y-grid-line { position: absolute; left: 0; right: 0; border-top: 1px solid rgba(148, 163, 184, .5); }
.activity-bars { position: absolute; left: 0; right: 0; top: 0; bottom: 32px; display: flex; align-items: end; gap: 4px; padding: 0 8px; }
.activity-bar { flex: 1; min-width: 5px; background: #93c5fd; border-radius: 8px 8px 2px 2px; position: relative; box-shadow: inset 0 -1px 0 rgba(30, 64, 175, .18); }
.activity-bar.me { background: linear-gradient(180deg, #f59e0b, #ef4444); box-shadow: 0 0 0 3px rgba(245, 158, 11, .18), inset 0 -1px 0 rgba(127, 29, 29, .25); }
.activity-bar.me::after { content: "you"; position: absolute; left: 50%; bottom: calc(100% + 22px); transform: translateX(-50%); background: #111827; color: #fff; border-radius: 999px; padding: .16rem .4rem; font-size: .68rem; font-weight: 950; white-space: nowrap; }
.bar-count { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); color: #0f172a; font-size: .68rem; font-weight: 950; white-space: nowrap; }
.bar-start { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.activity-x-axis { position: absolute; left: 8px; right: 8px; bottom: 0; height: 26px; border-top: 1px solid #cbd5e1; }
.activity-x-axis span { position: absolute; top: 6px; transform: translateX(-50%); color: #64748b; font-size: .72rem; font-weight: 950; }
.activity-x-axis span.me { color: #b45309; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 999px; padding: 0 .25rem; }
.activity-x-title { grid-column: 2; color: #64748b; font-size: .74rem; font-weight: 950; text-transform: uppercase; letter-spacing: .1em; align-self: end; }
.section-head { margin: 34px 0 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 14px; align-items: end; }
.section-head .eyebrow { color: #2563eb; }
.hist-controls { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 13px; box-shadow: 0 10px 28px rgba(15, 23, 42, .08); }
.hist-controls label { display: flex; justify-content: space-between; gap: 10px; color: #475569; font-size: .8rem; font-weight: 950; text-transform: uppercase; letter-spacing: .08em; }
.hist-controls label strong { color: #0f172a; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.hist-controls input[type="range"] { width: 100%; accent-color: #2563eb; margin: .65rem 0 .35rem; }
.hist-control-scale { display: flex; justify-content: space-between; gap: 12px; color: #64748b; font-size: .72rem; font-weight: 850; }
.event-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 14px; }
.event-card { padding: 16px; display: grid; gap: 12px; overflow: hidden; }
.event-card.best { outline: 3px solid rgba(22,163,74,.18); border-color: #86efac; }
.event-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.event-card h3 { font-size: 1.18rem; line-height: 1.1; margin: 0; letter-spacing: -.02em; }
.badge { display: inline-flex; align-items: center; justify-content: center; background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; border-radius: 999px; padding: .38rem .58rem; font-size: .78rem; font-weight: 950; white-space: nowrap; }
.badge.green { background: #ecfdf5; color: #166534; border-color: #86efac; }
.rank-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.rank-row strong { font-size: 2rem; line-height: 1; letter-spacing: -.04em; }
.rank-row small { color: #64748b; font-weight: 850; text-align: right; }
.meter { height: 12px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f97316, #22c55e); border-radius: 999px; }
.context { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.context div { background: #f8fafc; border: 1px solid var(--line); border-radius: 16px; padding: 10px; min-width: 0; }
.context .tie-box { background: #fff7ed; border-color: #fed7aa; }
.context span { display: block; color: #64748b; text-transform: uppercase; letter-spacing: .1em; font-size: .66rem; font-weight: 950; }
.context strong { display: block; font-size: 1.02rem; margin-top: .2rem; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.context em { display: block; margin-top: .08rem; color: #64748b; font-size: .76rem; font-style: normal; font-weight: 850; }
.hist { display: grid; gap: 6px; }
.hist-bars { height: 136px; display: flex; align-items: end; gap: 4px; padding: 8px 8px 16px; position: relative; background: linear-gradient(180deg, #fff, #f8fafc); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.hist-bar { flex: 1; background: #bfdbfe; border-radius: 7px 7px 1px 1px; min-height: 2px; }
.hist-marker { position: absolute; bottom: 12px; top: 8px; width: 3px; background: #ef4444; border-radius: 999px; box-shadow: 0 0 0 4px rgba(239,68,68,.16); }
.hist-marker::after { content: "you"; position: absolute; top: -2px; left: 7px; background: #ef4444; color: #fff; border-radius: 999px; padding: .12rem .35rem; font-size: .68rem; font-weight: 950; }
.hist-axis { display: flex; justify-content: space-between; color: #64748b; font-size: .76rem; font-weight: 850; padding: 0 2px; }
.hist-meta { color: #64748b; font-size: .74rem; font-weight: 850; text-align: center; }
.neighbors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.neighbor { background: #f8fafc; border: 1px solid var(--line); border-radius: 15px; padding: 10px; }
.neighbor span { display: block; color: #64748b; font-size: .73rem; font-weight: 950; text-transform: uppercase; letter-spacing: .08em; }
.neighbor strong { display: block; margin: .18rem 0; font-size: .92rem; }
.neighbor small { color: #475569; }
.note { color: #475569; margin: 0; font-size: .92rem; }
.source-quote { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 12px; padding: .65rem .75rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; overflow-wrap: anywhere; }
.note.important { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 14px; padding: .7rem .8rem; color: #7c2d12; font-weight: 800; }
.source-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; color: #64748b; font-size: .82rem; }
.source-row a { font-weight: 950; }
.explain { margin-top: 18px; padding: 18px; }
.empty-state { min-height: 180px; align-content: center; }
.raw-results { display: grid; gap: 12px; }
.raw-list { display: grid; gap: 8px; }
.raw-hit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; background: #f8fafc; border: 1px solid var(--line); border-radius: 16px; padding: .78rem .85rem; }
.raw-hit.structured { background: #eff6ff; border-color: #bfdbfe; }
.raw-hit span { display: block; color: #64748b; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 950; }
.raw-hit strong { display: block; margin: .1rem 0; }
.raw-hit p { margin: 0; color: #475569; overflow-wrap: anywhere; font-size: .9rem; }
.raw-hit a { font-weight: 950; }
.caveats { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.caveats li { background: #f8fafc; border: 1px solid var(--line); border-radius: 14px; padding: .72rem .85rem; color: #475569; }
.footer { max-width: 1180px; margin: 0 auto; color: #64748b; padding: 18px clamp(14px, 4vw, 42px) calc(28px + var(--safe)); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 750; }
@media (max-width: 940px) {
  .intro { grid-template-columns: 1fr; }
  .section-head { grid-template-columns: 1fr; align-items: stretch; }
  .context { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  body { background: linear-gradient(180deg, #07111f 0, #172554 900px, #eef4ff 901px, #f8fafc 100%); }
  .topbar { margin-bottom: 34px; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .lookup-row { grid-template-columns: 1fr; }
  .neighbors { grid-template-columns: 1fr; }
  .rank-row { grid-template-columns: 1fr; }
  .rank-row small { text-align: left; }
  .hero h1 { font-size: clamp(2.35rem, 14vw, 4rem); }
  .activity-chart { grid-template-columns: 46px minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .hero-stats { grid-template-columns: 1fr; }
  .event-card { border-radius: 20px; padding: 13px; }
  .event-top { display: grid; }
  .context { grid-template-columns: 1fr; gap: 6px; }
  .hist-bars { height: 120px; }
  .source-row { display: grid; }
  .raw-hit { grid-template-columns: 1fr; }
  .topbar { display: grid; grid-template-columns: 1fr 1fr; }
  .topbar a { text-align: center; font-size: .82rem; }
  .activity-chart { min-height: 290px; grid-template-columns: 42px minmax(0, 1fr); padding: 10px 8px 8px; }
  .activity-bars { gap: 2px; padding: 0 4px; }
  .activity-bar { min-width: 3px; }
  .activity-x-axis { left: 4px; right: 4px; }
  .bar-count { font-size: .62rem; }
}
