:root {
  color-scheme: light dark;
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #1f1d1a;
  --muted: #6b665e;
  --line: #e2ded6;
  --accent: #b86e00;
  --accent-text: #ffffff;
  --ok: #1f7a3a;
  --bad: #b3261e;
  --row-hover: #faf6ee;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --card: #1f1e1b;
    --text: #ece8e1;
    --muted: #a39d92;
    --line: #34312c;
    --accent: #f0a53a;
    --accent-text: #1a1206;
    --ok: #6cc98a;
    --bad: #f28b82;
    --row-hover: #26241f;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

h1 { margin: 0; font-size: 18px; color: var(--accent); }
h1 .sub { color: var(--muted); font-size: 13px; font-weight: 400; margin-left: 6px; }
h2 { margin: 0 0 8px; font-size: 16px; }

main { padding: 16px; max-width: 1400px; margin: 0 auto; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.narrow { max-width: 460px; margin: 48px auto; }

label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }

input, select {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}

button {
  font: inherit;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}

button.quiet { background: transparent; color: var(--text); border-color: var(--line); }
button:disabled { opacity: 0.6; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#login-form { display: grid; gap: 8px; }

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
}

.actions { display: flex; gap: 8px; }

.head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.verify { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.ok { color: var(--ok); font-weight: 600; }
.bad, .error { color: var(--bad); font-weight: 600; }
.status, .hint { color: var(--muted); }
.hint { font-size: 12px; }
.more { text-align: center; }

.table-wrap { overflow-x: auto; padding: 0; }

table { border-collapse: collapse; width: 100%; }

th, td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  white-space: nowrap;
}

th { font-size: 12px; color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--card); }

tbody tr.event { cursor: pointer; }
tbody tr.event:hover { background: var(--row-hover); }
tbody tr.detail td { white-space: normal; background: var(--bg); }

.mono, code, pre { font-family: var(--mono); font-size: 12.5px; }
td.payload { white-space: normal; min-width: 180px; }
pre { margin: 0; white-space: pre-wrap; word-break: break-all; }

button { white-space: nowrap; }
@media (max-width: 520px) {
  h1 .sub { display: none; }
}
