/* One hand-written stylesheet for the console. No framework, no build step.
   Keep it plain: the people using these screens are reading, not admiring. */

:root {
  --ink: #1a1d21;
  --dim: #6b7280;
  --line: #e3e6ea;
  --page: #f6f7f9;
  --card: #ffffff;
  --blue: #1f5fbf;
  --bad: #b32d2e;
  --good: #2e7d32;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

/* ── Top bar ─────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 24px;
  height: 56px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { font-weight: 600; color: var(--ink); }
.brand:hover { text-decoration: none; }

.topbar nav { display: flex; gap: 20px; flex: 1; }
.topbar nav a { color: var(--dim); padding: 4px 0; border-bottom: 2px solid transparent; }
.topbar nav a.on { color: var(--ink); border-bottom-color: var(--blue); }
.topbar nav a.soon { color: #b6bcc4; cursor: default; }
.topbar nav a.soon:hover { text-decoration: none; }

.who { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 14px; }
.who button {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
  color: var(--dim);
  cursor: pointer;
  font: inherit;
}
.who button:hover { color: var(--ink); border-color: #c8cdd4; }

/* ── Page ────────────────────────────────────────────────────────────── */
main { max-width: 1000px; margin: 32px auto; padding: 0 24px; }

.head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
h1 { font-size: 22px; margin: 0; }

.head-actions { display: flex; align-items: center; gap: 18px; }

.lede { color: var(--dim); max-width: 640px; margin: -6px 0 20px; }

/* ── Variant types ───────────────────────────────────────────────────── */
.kind { margin-bottom: 16px; }
.kind-head { display: flex; align-items: baseline; justify-content: space-between; }
.kind-head h2 { font-size: 16px; margin: 0; }
.kind p { margin: 6px 0 12px; }

.values { list-style: none; padding: 0; margin: 0 0 14px; }
.values li { padding: 7px 0; border-top: 1px solid var(--line); }
.values li span { margin-left: 10px; }

.button {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  padding: 8px 14px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
}
.button:hover { background: #17509f; text-decoration: none; }

/* A second-rank button: a real action, but not the one you came to press. */
.button.quiet { background: none; color: var(--blue); border: 1px solid var(--line); }
.button.quiet:hover { background: var(--page); }

.head-actions form { margin: 0; }

.restate { display: flex; align-items: center; gap: 12px; margin-top: 16px; max-width: 620px; }

/* ── Tables ──────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }

.dim { color: var(--dim); font-size: 13px; }
.bad { color: var(--bad); }
.good { color: var(--good); }
.empty { color: var(--dim); padding: 28px 14px; }

.tag {
  margin-left: 8px;
  font-size: 11px;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}

.warn { color: #8a6100; }

.crumb { color: var(--dim); font-size: 13px; margin: 0 0 10px; }

/* ── Search ──────────────────────────────────────────────────────────── */
.searchbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.searchbar input {
  width: 320px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: var(--card);
}
.searchbar input:focus { outline: 2px solid #cfe0ff; border-color: var(--blue); }

/* ── Filters ─────────────────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 4px; margin: -6px 0 16px; font-size: 13px; }
.filters a { padding: 4px 10px; border-radius: 6px; color: var(--dim); }
.filters a:hover { background: var(--card); text-decoration: none; }
.filters a.on {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 3px 9px;
}
.filters b { font-weight: 600; }

/* ── Forms ───────────────────────────────────────────────────────────── */
.form { max-width: 620px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--dim); margin-bottom: 5px; }

.form input[type="text"],
.form input[type="url"],
.form input[type="number"],
.form textarea,
.form select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: #fff;
}
.form textarea { resize: vertical; }
.form input:focus, .form textarea:focus, .form select:focus {
  outline: 2px solid #cfe0ff;
  border-color: var(--blue);
}

/* A checkbox reads better with its label beside it, not above. */
.field input[type="checkbox"] { margin-right: 8px; }

.help { color: var(--dim); font-size: 13px; margin: 6px 0 0; }
.errors { color: var(--bad); font-size: 13px; margin: 6px 0 0; }

/* Variant checkboxes: one per line, so long labels stay readable. */
.checks label { display: inline; }
.checks > label { display: block; }
.checks div { margin: 3px 0; }
.checks input[type="checkbox"] { margin-right: 8px; }

.actions { display: flex; align-items: center; gap: 16px; margin-top: 24px; }
.actions a { color: var(--dim); }

/* Delete sits apart from Save so it is never the button you hit by habit. */
.danger {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--bad);
  font: inherit;
  cursor: pointer;
  padding: 8px 0;
}
.danger:hover { text-decoration: underline; }

/* ── Messages ────────────────────────────────────────────────────────── */
.flash {
  padding: 10px 14px;
  border-radius: 6px;
  background: #eef4ff;
  border: 1px solid #cfe0ff;
  margin: 0 0 16px;
}
.flash.error { background: #fdeceb; border-color: #f5c6c4; color: var(--bad); }
.flash.success { background: #edf7ee; border-color: #c9e6cb; color: var(--good); }

/* ── Login ───────────────────────────────────────────────────────────── */
body.centred { display: grid; place-items: center; min-height: 100vh; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
}
.login { width: 320px; }
.login h1 { font-size: 18px; margin: 0 0 20px; }
.login label { display: block; font-size: 13px; color: var(--dim); margin: 12px 0 5px; }
.login input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}
.login input:focus { outline: 2px solid #cfe0ff; border-color: var(--blue); }
.login button {
  width: 100%;
  margin-top: 20px;
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 10px;
  font: inherit;
  cursor: pointer;
}
.login button:hover { background: #17509f; }

/* ── Test page ───────────────────────────────────────────────────────── */
.turn { margin-bottom: 20px; }
.turn h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--dim);
  font-weight: 600;
  margin: 22px 0 8px;
}
.turn h2:first-of-type { margin-top: 0; }
.turn table { margin: 0; }

.trace { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.trace li {
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 13px;
}

/* pre-wrap on purpose: an entry with no written answer falls back to its raw
   details, and seeing those line breaks is how you spot the problem. */
.says {
  background: #f3f8f3;
  border: 1px solid #c9e6cb;
  border-radius: 8px;
  padding: 14px;
  margin: 0;
  white-space: pre-wrap;
}

.tag.bad { color: var(--bad); border-color: #f5c6c4; }
