:root {
  --fg: #e6edf3;
  --muted: #8b949e;
  --line: #2a313c;
  --bg: #0f141a;
  --card: #161b22;
  --accent: #58a6ff;
  --ok: #3fb950;   --ok-bg: #122e1c;
  --warn: #d29922; --warn-bg: #2e2410;
  --bad: #f85149;  --bad-bg: #2e1414;
  --muted-bg: #21262d;
  --th-bg: #1b212b;
  --row-hover: #1c222c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  color-scheme: dark; /* native controls (scrollbars, form widgets) render dark too */
  line-height: 1.5;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
header form { margin: 0; }

main { max-width: 1600px; margin: 0 auto; padding: 1.25rem 1.5rem; }
/* auth + onboarding pages: a narrow column centered in the viewport, vertically and horizontally */
main.login {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

h1 { font-size: 1.5rem; margin: 0.4rem 0 1rem; }
h2 { font-size: 1.05rem; margin: 1.5rem 0 0.6rem; }

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

code { background: var(--muted-bg); padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.9em; }

button {
  font: inherit;
  color: var(--fg);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 6px;
  cursor: pointer;
}
button:hover { border-color: var(--muted); }

input[type=email], input[type=password], input[type=text] {
  font: inherit;
  color: var(--fg);
  background: var(--card);
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  width: 100%;
}
input:focus { outline: none; border-color: var(--accent); }

/* horizontal scroll only when the window is too narrow for the table */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  white-space: nowrap; /* keep short codes/numbers (e.g. "14.4 ms") on one line */
}
/* long-content columns (URL, Tier, Detail) wrap instead of forcing the table wide */
th.wrap, td.wrap { white-space: normal; overflow-wrap: anywhere; }
th {
  background: var(--th-bg);
  font-weight: 600;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--row-hover); }

/* outcome state on the result cell */
.result { font-weight: 600; }
.result.verified     { color: var(--ok); }
.result.warm         { color: var(--accent); }
.result.blocked,
.result.failed       { color: var(--bad); }
.result.inconclusive { color: var(--warn); }
.result.unserved     { color: var(--muted); font-weight: 500; }

/* status pill on the job list / detail header */
.pill {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--muted-bg);
  color: var(--muted);
}
.pill.ok      { background: var(--ok-bg);   color: var(--ok); }
.pill.partial { background: var(--warn-bg); color: var(--warn); }
.pill.failed  { background: var(--bad-bg);  color: var(--bad); }

.disclosure { color: var(--muted); font-size: 0.85rem; margin-top: 1.25rem; }
.empty { color: var(--muted); }
.error-msg { color: var(--bad); }
.muted { color: var(--muted); font-size: 0.85rem; }
.apikey { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--card); color: var(--fg); padding: 0.65rem 0.8rem; border-radius: 6px; word-break: break-all; font-size: 0.95rem; }
