/* agent_detect: one small stylesheet, dark text on a light background, system fonts. */
* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 24px 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f7f7f5;
}
main { max-width: 720px; margin: 0 auto; }
main.wide { max-width: 1200px; }
h1 { margin: 0 0 12px; font-size: 28px; }
a { color: #1d4ed8; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
.lead { margin: 0 0 20px; }
.muted { color: #5c5c5c; }

.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}
.card .row { display: flex; gap: 12px; align-items: baseline; padding: 4px 0; flex-wrap: wrap; }
.card .label { width: 110px; flex: none; color: #5c5c5c; }
.card .row:empty { display: none; }

.try { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
button, input {
  font: inherit;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid #bbb;
  background: #fff;
  color: #1a1a1a;
}
button { cursor: pointer; background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
button:hover { background: #333; }
input { flex: 1; min-width: 180px; }

.badge {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #6b7280;
}
.badge.human { background: #15803d; }
.badge.agent { background: #b91c1c; }
.badge.non_browser { background: #c2410c; }
.badge.undetermined { background: #6b7280; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid #ddd; border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid #eee; white-space: nowrap; vertical-align: top; }
th { background: #f0f0ee; font-weight: 600; }
tr.session { cursor: pointer; }
tr.session:hover, tr.session.open { background: #f3f6fb; }
tr.detail td { background: #fafafa; white-space: normal; }
tr.detail pre { margin: 0; max-height: 480px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* All-rules table (verdict.rules_checked): fired red, clear green, skipped grey with its reason. */
.badge.fired { background: #b91c1c; }
.badge.clear { background: #15803d; }
.badge.skipped { background: #6b7280; }
.rules-wrap { margin-bottom: 20px; }
/* Fixed layout: the table never grows past its container; Evidence takes the remaining width
   and long values (comma-separated lists, rule names) wrap instead of overflowing. */
.rules-wrap table { table-layout: fixed; }
.rules-wrap th, .rules-wrap td { white-space: normal; overflow-wrap: anywhere; word-break: break-word; padding: 5px 8px; }
.rules-wrap th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rules-wrap th:nth-child(1) { width: 7%; }
.rules-wrap th:nth-child(2) { width: 26%; }
.rules-wrap th:nth-child(3) { width: 9%; }
.rules-wrap th:nth-child(4) { width: 9%; }
.rules-wrap th:nth-child(5) { width: 15%; }
.rules-wrap td:nth-child(5) { color: #5c5c5c; }
.rules-wrap .badge { padding: 1px 7px; font-size: 12px; white-space: nowrap; }
@media (max-width: 560px) {
  .rules-wrap table { font-size: 12px; }
  .rules-wrap th, .rules-wrap td { padding: 4px 4px; }
  .rules-wrap .badge { padding: 0 5px; font-size: 11px; }
  .rules-wrap th:nth-child(1) { width: 10%; }
  .rules-wrap th:nth-child(2) { width: 21%; }
  .rules-wrap th:nth-child(3) { width: 13%; }
  .rules-wrap th:nth-child(4) { width: 9%; }
  .rules-wrap th:nth-child(5) { width: 19%; }
}
/* /live: the detail panel stays as wide as the visible part of the sessions table (which may
   scroll sideways) and stays in view while it scrolls. */
tr.detail > td > * { position: sticky; left: 10px; max-width: calc(min(100vw - 32px, 1200px) - 22px); }
