:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1d2330;
  --muted: #6b7280;
  --line: #e3e6eb;
  --accent: #2f5bd3;
  --ok: #1f7a4d;
  --warn: #9a5b00;
  --bad: #b3261e;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0.4rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.4rem 0 0.6rem; }
.top { display: flex; gap: 24px; align-items: center; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.top nav { display: flex; gap: 16px; flex: 1; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.logout { display: flex; gap: 8px; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.project-card { color: inherit; text-decoration: none; }
.project-card:hover { border-color: var(--accent); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
label { display: block; margin: 8px 0; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
textarea { width: 100%; }
button { font: inherit; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.link { background: none; border: none; color: var(--accent); padding: 0; }
button.danger { background: var(--bad); border-color: var(--bad); }
button.small { padding: 3px 8px; font-size: 0.9rem; }
.buttons { display: flex; gap: 8px; }
.muted { color: var(--muted); }
.ok, .status-success, .status-approved { color: var(--ok); }
.warn, .status-queued, .status-running, .status-draft { color: var(--warn); }
.error, .status-failed, .status-interrupted, .status-rejected { color: var(--bad); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--card); }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; white-space: nowrap; }
.caption, .brief { white-space: pre-wrap; }
.filters { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.facts dt { color: var(--muted); }
.statement { font-size: 1.3rem; }
.login { max-width: 360px; margin: 10vh auto; }
.history { padding-left: 18px; }
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.posts.compact { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.post { padding: 0; margin: 0; overflow: hidden; font-size: 0.85rem; }
.post > p, .post > details, .post > .actions { margin: 6px 8px; }
.post.marked { border-color: var(--ok); box-shadow: 0 0 0 2px var(--ok) inset; }
.thumb { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 4; background: var(--line); overflow: hidden; color: var(--muted); text-decoration: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: 6px; right: 6px; padding: 2px 7px; border-radius: 10px; background: #fff3c4; color: #7a4b00; font-weight: 700; font-size: 0.8rem; }
.stats { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; gap: 8px; flex-wrap: wrap; padding: 3px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.75rem; }
.who { display: flex; justify-content: space-between; gap: 6px; }
.who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Someone else's audience is in a collab's numbers: say so on the card. */
.collab { margin: 0; color: var(--warn); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.found-by { margin: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
form.inline { display: inline; margin: 0; }
.caption-short { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.actions { display: flex; gap: 6px; }
.actions button:first-child { flex: 1; }
button.ghost { background: none; border-color: var(--line); color: var(--muted); }
button.done { background: var(--ok); border-color: var(--ok); }
.subtabs { margin-top: -8px; }
.small-text { font-size: 0.85rem; }
.read-panel { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* production board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.board .column { background: var(--bg); border-radius: 8px; padding: 8px; min-height: 200px; }
.board .column h2 { font-size: 0.95rem; margin: 0 0 8px; }
.board-card { display: block; margin-bottom: 8px; color: inherit; text-decoration: none; }
.board-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; }
.board-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 12px; }
.unit-cover { max-width: 240px; border-radius: 6px; }

/* leads: the scout's feed */
.leads { display: grid; gap: 12px; }
.lead { margin-bottom: 0; }
.lead h3 { margin: 4px 0 2px; }
.lead .original { margin: 0 0 6px; font-size: 0.85em; color: var(--muted); }
.lead-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tag { font-size: 0.85em; padding: 2px 8px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.lead-summary summary { cursor: pointer; }
.lead-take { margin: 8px 0 4px; }
.lead-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lead-dismissed, .lead-expired { opacity: 0.6; }
.lead-days { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; }
.lead-days a { padding: 4px 8px; border-radius: 6px; text-decoration: none; color: var(--muted); }
.lead-days a.active { color: #fff; background: var(--accent); }
.lead-day { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 20px; }
.lead-day h2 { margin: 0; font-size: 1.05em; }
.nav-badge:empty { display: none; }
.nav-badge { margin-left: 4px; padding: 0 6px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 0.8em; }
@media (max-width: 600px) { .lead-actions button { flex: 1 1 40%; } }
