/* Argus — plain, dependency-free styles. No external fonts or CDNs by design:
   the page itself must not leak the visitor to any third party. */

:root {
  --ink: #16181d;
  --muted: #5b6470;
  --line: #e2e5ea;
  --bg: #f6f7f9;
  --card: #ffffff;
  --accent: #1f6feb;
  --warn-bg: #fff8e6;
  --warn-line: #e8d48a;
  --raw: #b3411f;   /* raw wire layer */
  --rails: #1f6feb; /* Rails' digested view */
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.wrap { max-width: 940px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

header.masthead { border-bottom: 2px solid var(--ink); padding-bottom: 1rem; margin-bottom: 1.75rem; }
header.masthead h1 { margin: 0; font-size: 1.6rem; letter-spacing: -0.01em; }
header.masthead .tagline { color: var(--muted); margin: 0.35rem 0 0; }
header.masthead nav { margin-top: 0.75rem; font-size: 0.9rem; }
header.masthead nav a { color: var(--accent); text-decoration: none; margin-right: 1rem; }
header.masthead nav a:hover { text-decoration: underline; }

.lede { color: var(--muted); margin: 0 0 1.75rem; max-width: 62ch; }

section.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
}
section.card > h2 { margin: 0 0 0.25rem; font-size: 1.05rem; }
section.card > .hint { color: var(--muted); font-size: 0.88rem; margin: 0 0 0.9rem; }

table.kv { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.kv th, table.kv td { text-align: left; padding: 0.4rem 0.6rem; vertical-align: top; border-bottom: 1px solid var(--line); }
table.kv th { width: 34%; font-weight: 600; color: var(--muted); font-family: var(--sans); }
table.kv td { font-family: var(--mono); word-break: break-word; }
table.kv tr:last-child th, table.kv tr:last-child td { border-bottom: 0; }

/* The raw-vs-Rails contrast: the centrepiece of the page. */
.contrast td.val { font-family: var(--mono); }
.tag { display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.1rem 0.4rem; border-radius: 4px; vertical-align: middle; }
.tag.raw { color: var(--raw); background: #fbeae3; }
.tag.rails { color: var(--rails); background: #e6effd; }

.note { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 6px; padding: 0.75rem 0.9rem; font-size: 0.86rem; color: #6b5a1e; margin-top: 0.9rem; }

.empty { color: var(--muted); font-style: italic; }

footer.foot { margin-top: 2.5rem; color: var(--muted); font-size: 0.82rem; border-top: 1px solid var(--line); padding-top: 1rem; }

/* Stats page bits */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.9rem; margin-bottom: 1.25rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 0.9rem 1rem; }
.stat .n { font-size: 1.8rem; font-weight: 700; font-family: var(--mono); }
.stat .l { color: var(--muted); font-size: 0.82rem; }

table.rank { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.rank th, table.rank td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line); }
table.rank th { color: var(--muted); font-weight: 600; }
table.rank td.count { text-align: right; font-family: var(--mono); width: 5rem; }
.bar { position: relative; }
.bar > span { display: inline-block; height: 0.5rem; background: var(--accent); border-radius: 3px; vertical-align: middle; }

.overflow { overflow-x: auto; }

/* Captured-requests feed */
nav.filters { font-size: 0.88rem; }
nav.filters a {
  display: inline-block; margin-right: 0.5rem; padding: 0.2rem 0.6rem;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--accent); text-decoration: none; background: var(--card);
}
nav.filters a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

table.feed thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
table.feed td { vertical-align: top; }
table.feed td.mono { font-family: var(--mono); font-size: 0.84rem; }
table.feed td.nowrap { white-space: nowrap; }
table.feed td.ua { color: var(--muted); word-break: break-word; }
table.feed tr.hit td { background: #fff8f5; }
table.feed tr.hit td:first-child { box-shadow: inset 3px 0 0 var(--raw); }
table.feed a { color: var(--accent); text-decoration: none; font-size: 0.84rem; }
table.feed a:hover { text-decoration: underline; }
