:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #667085;
  --line: #e4e2dc;
  --accent: #2f6f5e;
  --accent-ink: #ffffff;
  --warn-bg: #fff4e0;
  --warn: #9a5b00;
  --bad-bg: #fde8e8;
  --bad: #a3271f;
  --out: #e8f1ee;
  --in: #eef0f6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17191c;
    --card: #20242a;
    --text: #e8e6e1;
    --muted: #9aa1ab;
    --line: #333840;
    --accent: #6fbfa6;
    --accent-ink: #10201b;
    --warn-bg: #3a2d14;
    --warn: #f0b860;
    --bad-bg: #3d1e1c;
    --bad: #f19a92;
    --out: #1f3029;
    --in: #262b36;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
}
header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--card);
  position: sticky; top: 0; z-index: 2; flex-wrap: wrap;
}
header h1 { font-size: 18px; margin: 0; }
nav { display: flex; gap: 6px; flex-wrap: wrap; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.card h2 { font-size: 16px; margin: 0 0 12px; }
.center { max-width: 460px; margin: 10vh auto; text-align: center; }
.big { font-size: 52px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "DejaVu Sans Mono", monospace; font-size: 13px; word-break: break-all; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: center; }
.row.left { justify-content: flex-start; }
button, .button {
  font: inherit; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  border-radius: 8px; padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-block;
}
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
nav button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
nav button { background: transparent; color: var(--accent); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px;
}
textarea { width: 100%; min-height: 110px; font-family: ui-monospace, "DejaVu Sans Mono", monospace; font-size: 13px; }
input.pin { font-size: 24px; letter-spacing: 8px; text-align: center; width: 180px; }
label { display: block; margin: 12px 0 4px; font-weight: 600; }
label.inline { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.hint { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat b { display: block; font-size: 24px; }
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.bar { height: 8px; background: var(--accent); border-radius: 4px; min-width: 2px; }
.timeline .ev { display: grid; grid-template-columns: 56px 110px 1fr; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.timeline .ev .time { color: var(--muted); font-variant-numeric: tabular-nums; }
.tag { font-size: 12px; border-radius: 6px; padding: 1px 7px; background: var(--in); white-space: nowrap; height: fit-content; }
.ev.chat_out .tag { background: var(--out); }
.ev.blocked .tag, .ev.flag .tag { background: var(--bad-bg); color: var(--bad); }
.ev.flag { background: var(--bad-bg); }
.alert { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.shot { max-width: 320px; width: 100%; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.hidden { display: none !important; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.small { font-size: 13px; }
@media (max-width: 600px) {
  .timeline .ev { grid-template-columns: 48px 1fr; }
  .timeline .ev .body { grid-column: 1 / -1; }
}
