:root {
  --ink: #16191d; --muted: #5f6b7a; --line: #e3e7ec; --bg: #f7f8fa;
  --card: #ffffff; --accent: #1f5f8b; --accent-soft: #eaf2f8;
  --warn: #9a3412; --warn-soft: #fef3e7; --good: #14633f; --good-soft: #e9f5ef;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header.top { background: var(--card); border-bottom: 1px solid var(--line); padding: 0 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
header.top .brand { font-weight: 650; letter-spacing: -0.01em; padding: 14px 0; }
header.top nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
header.top nav a { padding: 14px 9px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
header.top nav a:hover { color: var(--ink); text-decoration: none; }
header.top nav a.on { color: var(--accent); border-bottom-color: var(--accent); }
.acting { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted);
  white-space: nowrap; margin-left: auto; }
.acting select { font-size: 13px; }

main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -0.02em; }
h2 { font-size: 17px; margin: 32px 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 14px; margin: 0 0 10px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
p.lede { color: var(--muted); margin: 0 0 20px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px; margin-bottom: 18px; }
.grid { display: grid; gap: 14px; }
.grid.k4 { grid-template-columns: repeat(4, 1fr); }
.grid.k3 { grid-template-columns: repeat(3, 1fr); }
.grid.k2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid.k4, .grid.k3, .grid.k2 { grid-template-columns: 1fr; } }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.stat .n { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; }
.stat .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); font-style: italic; padding: 14px 10px; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px;
  font-weight: 550; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.grey { background: #eef1f4; color: var(--muted); }

form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 550; }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 7px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.field { min-width: 150px; flex: 1; margin-bottom: 10px; }
button { font: inherit; font-weight: 550; padding: 8px 16px; border-radius: 7px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
button:hover { background: #17496b; }
button.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
button.ghost:hover { background: #f0f3f6; }
button.tiny { padding: 3px 9px; font-size: 12px; }

details.adder { margin-bottom: 18px; }
details.adder > summary { cursor: pointer; font-weight: 550; color: var(--accent);
  padding: 8px 0; list-style: none; }
details.adder > summary::before { content: "+ "; font-weight: 700; }
details.adder[open] > summary::before { content: "− "; }
details.adder > div { background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 18px 20px; margin-top: 6px; }

.flag { border-left: 3px solid var(--warn); background: var(--warn-soft);
  padding: 10px 14px; border-radius: 0 7px 7px 0; margin-bottom: 8px; font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.right { text-align: right; }
.between { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }

/* Sections within one engagement. A second row of tabs under the page title,
   so the engagement's parts are always in the same place rather than a run of
   links buried in the text. */
.subnav { display: flex; gap: 2px; flex-wrap: wrap; margin: 0 0 22px;
  border-bottom: 1px solid var(--line); }
.subnav a { padding: 9px 14px; color: var(--muted); font-weight: 550; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subnav a:hover { color: var(--ink); background: #eef1f4; text-decoration: none;
  border-radius: 6px 6px 0 0; }
.subnav a.on { color: var(--accent); border-bottom-color: var(--accent); }
@media (max-width: 720px) {
  .subnav { overflow-x: auto; }
  .subnav a { padding: 9px 10px; font-size: 13px; }
}

/* Peer review: a verdict banner, and one block per check. The colour is the
   answer — green means a reviewer ticks it, red means they write it up. */
.verdict { border-radius: 10px; padding: 14px 18px; margin: 0 0 8px;
           font-weight: 550; border: 1px solid var(--line); }
.verdict.ok        { background: var(--good-soft); color: var(--good); border-color: #bfe0cf; }
.verdict.attention { background: var(--warn-soft); color: var(--warn); border-color: #f0dcc0; }
.verdict.missing   { background: #fdeaea; color: #9b1c1c; border-color: #f2c7c7; }

.check { border-left: 3px solid var(--line); padding: 10px 0 10px 14px; margin-bottom: 10px; }
.check:last-child { margin-bottom: 0; }
.check.ok        { border-left-color: var(--good); }
.check.attention { border-left-color: var(--warn); }
.check.missing   { border-left-color: #c53030; }
.check-title { font-weight: 550; margin-bottom: 3px; display: flex;
               align-items: center; gap: 8px; flex-wrap: wrap; }
.pill.bad { background: #fdeaea; color: #9b1c1c; }

/* A filter bar: the same controls as a form, but it sits above a table and
   has to stay on one or two lines rather than becoming a page of its own. */
form.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
               background: var(--card); border: 1px solid var(--line);
               border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
form.filters .field { margin-bottom: 0; min-width: 120px; }
form.filters select, form.filters input { width: 100%; }

/* Trends: a bar behind the number rather than a chart library. No build step,
   no JavaScript, and it prints. Each bar is scaled within its own row. */
table.trend td, table.trend th { white-space: nowrap; padding: 8px 10px; }
table.trend td.num { position: relative; min-width: 62px; }
table.trend .bar { position: absolute; left: 4px; right: 4px; bottom: 3px; height: 3px;
                   background: var(--line); border-radius: 2px; }
table.trend .bar::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0;
                          width: var(--fill); background: var(--accent); border-radius: 2px; }

/* Correspondence: a filed message. The body is preformatted because an email
   carries its own line breaks, indentation and quoted thread, and rewrapping
   it would change what the client actually wrote. */
.mail { border-left: 3px solid var(--accent); padding: 12px 0 12px 14px;
        margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.mail:last-child { margin-bottom: 0; border-bottom: 0; }
.mail.outbound { border-left-color: var(--line); }
.mail .mailbody { white-space: pre-wrap; word-wrap: break-word; font: inherit;
                  font-size: 14px; margin: 10px 0; color: var(--ink);
                  max-height: 420px; overflow-y: auto; }
