:root {
  --bg: #0f1216;
  --panel: #171c22;
  --panel-2: #1e252d;
  --line: #2a333d;
  --text: #e6edf3;
  --muted: #8b97a4;
  --accent: #4fb286;
  --accent-2: #d6a35c;
  --post: #4fb286;
  --reply: #6c8cc7;
  --danger: #d76a6a;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-head {
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 20px 12px;
  text-align: center;
}
.site-head h1 {
  font-family: var(--mono);
  font-size: 2.6rem;
  margin: 0;
  letter-spacing: -1px;
}
.site-head h1 .dot { color: var(--accent); }
.tag { color: var(--muted); margin: 6px 0 22px; }

.search {
  display: flex;
  gap: 8px;
  max-width: 460px;
  margin: 0 auto;
}
.search input {
  flex: 1;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: var(--mono);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
}
.search input:focus { outline: none; border-color: var(--accent); }
.search button {
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  background: var(--accent);
  color: #06281c;
  border: none;
  border-radius: 9px;
  cursor: pointer;
}
.search button:hover { filter: brightness(1.08); }
.search button:disabled { opacity: 0.5; cursor: wait; }

.examples { color: var(--muted); font-size: 0.85rem; margin-top: 12px; }

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 12px 20px 60px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 16px 0;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.card h2 { font-size: 1.15rem; margin: 0; }

.profile {
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile img {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--panel-2);
  object-fit: cover;
  flex-shrink: 0;
}
.profile .who { flex: 1; min-width: 0; }
.profile .name { font-weight: 700; font-size: 1.15rem; }
.profile .handle { color: var(--muted); font-family: var(--mono); font-size: 0.9rem; }
.profile .counts { display: flex; gap: 18px; margin-top: 6px; flex-wrap: wrap; }
.profile .counts span { font-size: 0.85rem; color: var(--muted); }
.profile .counts b { color: var(--text); }

.status { color: var(--muted); font-size: 0.9rem; padding: 4px 2px; min-height: 1.2em; text-align: center; }
.status.error { color: var(--danger); }

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 5;
}
.presets { display: flex; gap: 4px; flex-wrap: wrap; }
.presets button {
  padding: 7px 13px;
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.presets button:hover { color: var(--text); border-color: var(--accent); }
.presets button.active {
  background: var(--accent);
  color: #06281c;
  border-color: var(--accent);
  font-weight: 700;
}
.custom { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 0.85rem; }
.custom input[type="date"] {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
  font-family: var(--mono);
  color-scheme: dark;
}
.custom input[type="date"]:focus { outline: none; border-color: var(--accent); }

.meta { color: var(--muted); font-size: 0.88rem; margin: 2px 0 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
thead th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
td.cat { font-weight: 600; }
tr.sub td.cat { font-weight: 400; color: var(--muted); padding-left: 22px; }
tr.total td { border-top: 2px solid var(--line); font-weight: 700; }
.pill { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.pill.post { background: var(--post); }
.pill.reply { background: var(--reply); }

.chart-box { position: relative; height: 360px; margin-top: 6px; }

.window-pick, .check { color: var(--muted); font-size: 0.88rem; }
.window-pick select {
  margin-left: 6px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
  font-family: var(--mono);
}
.check input { vertical-align: middle; margin-right: 4px; }

.footnote { color: var(--muted); font-size: 0.8rem; margin: 14px 0 0; }
.footnote em { font-style: italic; color: #b3bdc7; }

#big-days { margin-top: 16px; }
#big-days h3 { font-size: 0.95rem; margin: 0 0 8px; color: var(--text); }
.bigday {
  display: flex; gap: 12px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.bigday .d { font-family: var(--mono); color: var(--accent-2); white-space: nowrap; }
.bigday .n { font-weight: 700; white-space: nowrap; }
.bigday .ctx { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.site-foot { text-align: center; color: var(--muted); font-size: 0.82rem; padding: 24px 20px 48px; }

.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
  vertical-align: middle; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .site-head h1 { font-size: 2rem; }
  .chart-box { height: 300px; }
}
