:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #16191d;
  --muted: #6b7280;
  --line: #e2e5ea;
  --accent: #1f5fa9;
  --ok: #1a7f4b;
  --warn: #b45309;
  --bad: #9b2c2c;
  --radius: 8px;
}

* { box-sizing: border-box; }

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { font-weight: 650; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.topbar nav a { color: var(--muted); text-decoration: none; }
.topbar nav a:hover { color: var(--accent); }
/* The generic button rule sets margin-top, which pushed this one out of line
   with the nav links beside it. */
.linkish { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; margin: 0; }
.linkish:hover { color: var(--accent); }
.topbar nav form { display: flex; margin: 0; }

main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 80px; }

/* Content links need an explicit themed colour. Left to the browser default
   they render as near-black navy on the dark background, which is exactly
   where it mattered: the RO number is the only way into a review. */
main a { color: var(--accent); }
main a:hover { text-decoration: none; }

h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0 0 10px; }
h2 .sub { font-weight: 400; color: var(--muted); font-size: 13px; }
.lede { color: var(--muted); margin: 0 0 18px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.hint.inline { margin-left: 10px; }
.muted { color: var(--muted); }
.error { color: var(--bad); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 18px;
}
.card.narrow { max-width: 360px; margin: 60px auto; }
.muted-card { opacity: 0.75; }
.recall pre { white-space: pre-wrap; font: inherit; margin: 0; color: var(--muted); }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type=password], textarea, select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
textarea { resize: vertical; }
select { width: auto; min-width: 190px; }

button {
  margin-top: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
button:hover { border-color: var(--accent); color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.08); color: #fff; }
button.secondary { background: #eef3fa; }
.actions { display: flex; gap: 10px; align-items: center; }
.cta {
  display: inline-block;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
}

table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.grid th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.kv td:first-child { color: var(--muted); }
table.grid tr.highlight td { background: #fdf6e7; font-weight: 600; }

.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.badge.done { color: var(--ok); border-color: #bfe3cd; background: #f0faf4; }
.badge.partial { color: var(--warn); border-color: #f0dcb4; background: #fdf6e7; }
.badge.todo { color: var(--muted); }

.ro-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.ro-head .meta { color: var(--muted); margin: 0; font-size: 13px; }
.stages { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; font-size: 12px; }
.stages li { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--panel); }
.stages li.on { color: var(--accent); border-color: #bcd3ee; background: #eef3fa; }

.job-text .cond { font-weight: 550; }
.job-text .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
td.vis { white-space: nowrap; width: 1%; }
td.caught { white-space: nowrap; width: 1%; }
.radio, .check { display: inline-flex; align-items: center; gap: 5px; margin: 0 8px 0 0; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--ink); }
.radio.on { border-color: var(--accent); background: #eef3fa; color: var(--accent); }
.radio input, .check input { margin: 0; }

.sheet-head { margin: 26px 0 10px; }
.contact-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.contact-sheet figure { margin: 0; }
.contact-sheet img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #e9ecf0;
  display: block;
}
.contact-sheet a:hover img { border-color: var(--accent); }

#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(12, 14, 17, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
#lightbox.on { display: flex; }
#lightbox img { max-width: 94vw; max-height: 88vh; object-fit: contain; }
#lightbox .cap { position: fixed; bottom: 14px; left: 0; right: 0; text-align: center; color: #cfd4da; font-size: 13px; }
#lightbox .nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.12); color: #fff; border: 0;
  font-size: 26px; line-height: 1; padding: 14px 18px; cursor: pointer; border-radius: 6px;
}
#lightbox .nav.prev { left: 14px; }
#lightbox .nav.next { right: 14px; }

@media (max-width: 720px) {
  .contact-sheet { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  td.vis, td.caught { white-space: normal; }
  .ro-head { flex-direction: column; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171b;
    --panel: #1b1f24;
    --ink: #e7eaee;
    --muted: #9aa3ad;
    --line: #2c333b;
    --accent: #6fa8e8;
  }
  input[type=password], textarea, select, button { background: #232830; color: var(--ink); }
  button.primary { background: var(--accent); color: #10141a; }
  button.secondary { background: #24303e; }
  .cta { color: #10141a; }
  .radio.on { background: #223046; }
  .stages li.on { background: #223046; border-color: #33506f; }
  .badge.done { background: #16281e; border-color: #27503a; }
  .badge.partial { background: #2a2417; border-color: #4d3f22; }
  table.grid tr.highlight td { background: #2a2417; }
  .contact-sheet img { background: #222831; }
}

.check.standalone { border: 0; padding: 0; margin-bottom: 6px; font-size: 14px; }
