/* NZBio News Desk — small, dense, readable. No framework, no build step. */
:root {
  --ink: #0f1d1a;
  --ink-soft: #4a5d58;
  --line: #dbe4e1;
  --bg: #f7faf9;
  --card: #ffffff;
  --green: #004d40;
  --green-mid: #00897b;
  --amber: #8a5a00;
  --red: #9b2c2c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--green-mid); }
a:hover { color: var(--green); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #eef4f2;
  padding: 1px 5px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------ top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--green);
  color: #fff;
}
.topbar .brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.brand-mark { color: #7fd6c6; }
.brand-sub { font-weight: 400; opacity: 0.75; font-size: 0.85em; }
.topbar nav { display: flex; align-items: center; gap: 18px; }
.topbar nav a { color: #cdeae4; text-decoration: none; font-size: 0.92em; }
.topbar nav a:hover { color: #fff; }
.inline { display: inline; margin: 0; }
.linkish {
  background: none; border: 0; color: #cdeae4; cursor: pointer;
  font: inherit; font-size: 0.92em; padding: 0;
}
.linkish:hover { color: #fff; }

/* ------------------------------------------------------------------ layout */
main { max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
h1 { font-size: 1.55em; margin: 0 0 6px; letter-spacing: -0.2px; }
h2 { font-size: 1.05em; margin: 0 0 4px; }
h2.tight { margin-top: 34px; }
.muted { color: var(--ink-soft); }
.tiny { font-size: 0.82em; }
.note { margin: 22px 0 0; color: var(--ink-soft); font-size: 0.92em; }
.note a { font-weight: 600; }
.counts { display: flex; flex-wrap: wrap; gap: 14px; }
.count { background: #e9f1ef; border-radius: 999px; padding: 3px 12px; font-size: 0.85em; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  margin-top: 18px;
}
.card.narrow { max-width: 420px; margin: 40px auto; }

/* ------------------------------------------------------------------ login */
label { display: block; font-size: 0.85em; color: var(--ink-soft); margin: 14px 0 5px; }
input[type=password], input[type=text] {
  width: 100%; padding: 9px 11px; font: inherit;
  border: 1px solid var(--line); border-radius: 7px; background: #fff;
}
input:focus { outline: 2px solid var(--green-mid); outline-offset: 1px; }

button {
  font: inherit; cursor: pointer; border-radius: 7px;
  border: 1px solid transparent; padding: 8px 14px;
}
button.primary {
  background: var(--green); color: #fff; margin-top: 16px;
}
button.primary:hover { background: #00695c; }
button.danger { background: #fff; color: var(--red); border-color: #e3b9b9; }
button.danger:hover { background: #fdf3f3; }
button.small { padding: 4px 10px; font-size: 0.85em; }
button.ghost { background: #fff; border-color: var(--line); color: var(--ink-soft); }

/* ------------------------------------------------------------------ lead cards */
.leadgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.lead {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lead-head { display: flex; gap: 13px; align-items: flex-start; }
.score {
  flex: none;
  background: var(--green);
  color: #fff;
  border-radius: 8px;
  min-width: 42px;
  text-align: center;
  padding: 7px 4px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.meta { margin: 0; font-size: 0.9em; color: var(--ink-soft); }
.claim { margin: 0; font-size: 0.88em; color: var(--amber); }
.site { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.site a { font-size: 0.86em; word-break: break-all; }

.why summary {
  cursor: pointer; font-size: 0.84em; color: var(--ink-soft);
  padding: 2px 0;
}
.why pre {
  margin: 8px 0 0; padding: 10px 12px; background: #f4f8f7;
  border-radius: 7px; font-size: 0.78em; line-height: 1.5;
  white-space: pre-wrap; color: var(--ink-soft);
  max-height: 220px; overflow: auto;
}

.actions {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start;
  margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line);
}
.actions form { margin: 0; }
.actions form.reject { display: flex; gap: 6px; flex: 1; min-width: 200px; }
.actions form.reject input { flex: 1; font-size: 0.85em; padding: 6px 9px; }
.actions button.primary { margin-top: 0; }
.actions button { padding: 6px 12px; font-size: 0.88em; }

/* ------------------------------------------------------------------ tables */
table.leads {
  width: 100%; border-collapse: collapse; margin-top: 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; font-size: 0.9em;
}
table.leads th, table.leads td {
  text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.leads th {
  background: #eef4f2; font-size: 0.82em; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--ink-soft);
}
table.leads tr:last-child td { border-bottom: 0; }
table.leads tr.below { background: #fbfbfa; color: var(--ink-soft); }
td.num { font-variant-numeric: tabular-nums; }
td.url a { word-break: break-all; font-size: 0.9em; }
td.msg { max-width: 520px; word-break: break-word; }
td.act { white-space: nowrap; }
td.act form { display: inline; margin: 0 0 0 4px; }

/* ------------------------------------------------------------------ bits */
.pill {
  display: inline-block; padding: 1px 9px; border-radius: 999px;
  font-size: 0.76em; font-weight: 600; white-space: nowrap;
}
.pill-ok { background: #e0f2ee; color: var(--green); }
.pill-no { background: #fbeaea; color: var(--red); }

.flash {
  padding: 11px 14px; border-radius: 8px; margin: 0 0 14px; font-size: 0.92em;
}
.flash-ok { background: #e0f2ee; color: var(--green); }
.flash-error { background: #fbeaea; color: var(--red); }

.toggle { margin: 14px 0 0; font-size: 0.9em; }
.decided { list-style: none; padding: 0; margin: 10px 0 0; font-size: 0.9em; }
.decided li { padding: 6px 0; border-bottom: 1px solid var(--line); }

.foot {
  text-align: center; padding: 20px; font-size: 0.8em; color: var(--ink-soft);
  border-top: 1px solid var(--line);
}
.foot p { margin: 0; }

/* ------------------------------------------------------------------ articles, brain, settings */
/* Added 30 Oct 2026 with the /articles, /brain and /settings pages. Kept in the existing
   palette so the new pages do not look bolted on. */

h2 { margin: 28px 0 8px; font-size: 1.12em; }
h3 { margin: 20px 0 6px; font-size: 1em; }

.small { font-size: 0.85em; }
.warn { color: var(--red); font-weight: 600; }

.tally {
  margin: 8px 0 4px; color: var(--ink-soft); font-size: 0.9em;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}

.card.notice {
  border-left: 4px solid var(--green-mid);
  background: #fbfdfc;
  margin: 18px 0;
}
.card.notice h2 { margin-top: 0; }
.card.notice p { margin: 8px 0; font-size: 0.94em; }
.card.notice code {
  background: #eef4f2; padding: 1px 5px; border-radius: 4px; font-size: 0.9em;
}

.empty {
  margin: 8px 0 18px; padding: 12px 14px; color: var(--ink-soft);
  background: #fbfdfc; border: 1px dashed var(--line); border-radius: 8px;
  font-size: 0.9em;
}

.crumbs { margin: 0 0 6px; font-size: 0.88em; }

/* tables on the new pages */
table.grid {
  width: 100%; border-collapse: collapse; margin: 10px 0 22px;
  font-size: 0.9em; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
table.grid th, table.grid td {
  text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.grid thead th {
  background: #f2f7f5; color: var(--ink-soft);
  font-size: 0.86em; text-transform: uppercase; letter-spacing: 0.03em;
}
table.grid tbody tr:last-child th, table.grid tbody tr:last-child td { border-bottom: none; }
table.grid tbody th { width: 40%; font-weight: 600; color: var(--ink-soft); }

/* article states */
.pill-draft { background: #fff3d6; color: var(--amber); }
.pill-approved { background: #e0f2ee; color: var(--green); }
.pill-published { background: var(--green); color: #fff; }
.pill-failed { background: #fbeaea; color: var(--red); }

/* article preview and auditable notes */
.preview {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 18px 20px; margin: 10px 0 22px; line-height: 1.65;
}
.preview h2 { margin-top: 0; }
.notes {
  background: #f2f7f5; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; font-size: 0.84em; white-space: pre-wrap;
  word-break: break-word; margin: 8px 0 18px;
}

/* settings form */
form.settings {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 20px 20px; margin: 10px 0 24px;
}
.field { padding: 14px 0; border-bottom: 1px solid var(--line); }
.field:last-of-type { border-bottom: none; }
.field label { margin-top: 0; font-size: 0.9em; font-weight: 600; color: var(--ink); }
.field input { width: 100%; max-width: 320px; }
.help { margin: 6px 0 0; font-size: 0.84em; color: var(--ink-soft); max-width: 60ch; }
.field .muted.small { margin: 4px 0 0; }

/* brain suggestions */
.suggestions { list-style: none; padding: 0; margin: 10px 0 22px; }
.suggestion {
  background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--line); border-radius: 8px;
  padding: 12px 16px; margin: 0 0 10px;
}
.suggestion-strong { border-left-color: var(--green-mid); }
.suggestion-weak { border-left-color: var(--amber); }
.suggestion p { margin: 6px 0 0; font-size: 0.9em; color: var(--ink-soft); }

/* brain gaps */
.gaps { margin: 8px 0 22px; padding-left: 20px; font-size: 0.92em; }
.gaps li { margin: 7px 0; line-height: 1.5; }
