:root {
  --paper: #F7F6F2;
  --ink: #1A1A1A;
  --ink-soft: #444;
  --muted: #888;
  --green: #2E7D5B;
  --green-tint: #E8F2EC;
  --line: #D0CECC;
  --danger: #C0392B;
  --amber: #854F0B;
  --display: 'Fraunces', Georgia, serif;
  --body: 'Hanken Grotesk', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
}

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 28px; border-bottom: 1.5px solid var(--ink);
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(46,125,91,0.06), transparent 60%),
    var(--paper);
}
.wordmark { font-family: var(--display); font-weight: 600; font-size: 24px; text-decoration: none; color: var(--ink); letter-spacing: -0.5px; }
.wordmark span { color: var(--green); }
.topbar nav a { margin-left: 18px; color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.topbar nav a:hover { color: var(--green); }

main { max-width: 1040px; margin: 0 auto; padding: 32px 28px; }

h1 { font-family: var(--display); font-weight: 600; font-size: 32px; line-height: 1.15; margin-bottom: 6px; }
.subtitle { color: var(--ink-soft); margin-bottom: 22px; }

.flash.error { background: #fbe9e7; border-left: 3px solid var(--danger); padding: 10px 14px; border-radius: 6px; margin-bottom: 18px; }

/* Login */
.login { max-width: 560px; margin: 8vh auto 0; text-align: left; }
.login h1 { font-size: 40px; }
.btn-google {
  display: inline-block; margin-top: 18px; padding: 12px 20px;
  background: var(--green); color: #fff; border-radius: 8px; text-decoration: none; font-weight: 600;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-google:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(46,125,91,0.25); }

/* Today agenda */
.today { animation: rise .5s ease both; }
.agenda { list-style: none; }
.agenda-item {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: 10px; padding: 14px 16px; margin-bottom: 10px;
  border: 1px solid var(--line);
  animation: rise .5s ease both;
}
.agenda-item:nth-child(1) { animation-delay: .04s; }
.agenda-item:nth-child(2) { animation-delay: .08s; }
.agenda-item:nth-child(3) { animation-delay: .12s; }
.agenda-item:nth-child(n+4) { animation-delay: .16s; }
.kind-marker { width: 4px; align-self: stretch; border-radius: 4px; background: var(--muted); }
.deadline_approaching .kind-marker { background: var(--danger); }
.next_action_due .kind-marker { background: var(--amber); }
.stalled_in_stage .kind-marker { background: var(--muted); }
.agenda-body { flex: 1; }
.agenda-grant { font-weight: 600; }
.agenda-msg { color: var(--ink-soft); font-size: 14px; }
.agenda-open { color: var(--green); text-decoration: none; font-weight: 600; }
.empty { color: var(--ink-soft); }
.board-link { margin-top: 18px; }
.board-link a, .empty a { color: var(--green); text-decoration: none; font-weight: 600; }

/* Board */
.new-grant { display: flex; gap: 8px; margin: 14px 0 22px; }
.new-grant input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-family: var(--body); }
.new-grant input[name=title] { flex: 1; }
.new-grant button, .grant-form button { padding: 10px 16px; background: var(--ink); color: #fff; border: 0; border-radius: 8px; font-weight: 600; cursor: pointer; }

.columns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.column { background: rgba(0,0,0,0.02); border-radius: 10px; padding: 12px; min-height: 200px; }
.column-title { font-family: var(--display); font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.card-title { font-weight: 600; }
.card-funder { color: var(--ink-soft); font-size: 13px; }
.card-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.card-move select { margin-top: 8px; width: 100%; padding: 6px; border: 1px solid var(--line); border-radius: 6px; font-family: var(--body); }

.grant-form { display: grid; gap: 10px; max-width: 480px; }
.grant-form label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-soft); }
.grant-form input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; font-family: var(--body); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .columns { grid-template-columns: 1fr 1fr; }
}

/* Evidence file */
.evidence-head .back { color: var(--green); text-decoration: none; font-size: 13px; }
.evidence-head h1 { margin-top: 6px; }
#evidence-file { display: grid; gap: 22px; margin-top: 18px; }
#evidence-file h2 { font-family: var(--display); font-size: 18px; margin-bottom: 10px; }
.award-terms form { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.award-terms label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.award-terms input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-family: var(--body); }
.q-block { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.q-prompt { font-weight: 600; margin-bottom: 8px; }
.entries { list-style: none; margin: 0 0 8px; padding: 0; }
.entries li { border-left: 2px solid var(--green); padding: 4px 0 4px 10px; margin-bottom: 4px; font-size: 13px; }
.entries .d, .note-stream .d { color: var(--muted); font-size: 11px; margin-right: 6px; }
.add-entry, .add-question, .add-note { display: flex; gap: 8px; margin-top: 8px; }
.add-entry input, .add-question input, .add-note input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-family: var(--body); }
.add-entry button, .add-question button, .add-note button, .award-terms button { padding: 8px 14px; background: var(--ink); color: #fff; border: 0; border-radius: 7px; font-weight: 600; cursor: pointer; }
.remove-q { margin-top: 6px; }
.remove-q .link { background: none; border: 0; color: var(--muted); font-size: 11px; text-decoration: underline; cursor: pointer; padding: 0; }
.note-stream { list-style: none; margin: 0 0 8px; padding: 0; }
.note-stream li { border-bottom: 1px solid #f0efeb; padding: 7px 0; font-size: 13px; }
.note-stream a { color: var(--green); margin-left: 6px; }
.card-evidence { display: inline-block; margin-top: 8px; color: var(--green); text-decoration: none; font-size: 12px; font-weight: 600; }

/* Report page */
.report-head .back { color: var(--green); text-decoration: none; font-size: 13px; }
.report-link { display: inline-block; margin-top: 8px; color: var(--green); text-decoration: none; font-weight: 600; }
.report-generate { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.report-generate button, .report-submit button, .answer-block button[type=submit] { padding: 9px 16px; background: var(--ink); color: #fff; border: 0; border-radius: 7px; font-weight: 600; cursor: pointer; }
.report-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--ink-soft); margin: 12px 0 18px; }
.submitted-badge { color: var(--green); font-weight: 600; }
.answer-block { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.answer-prompt { font-weight: 600; margin-bottom: 8px; }
.answer-block textarea { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; font-family: var(--body); font-size: 13px; box-sizing: border-box; }
.answer-body-final { white-space: pre-wrap; font-size: 13px; color: #333; }
.answer-block .refresh { margin-top: 6px; }
.answer-block .refresh .link { background: none; border: 0; color: var(--muted); font-size: 11px; text-decoration: underline; cursor: pointer; padding: 0; }
.report-submit { margin: 8px 0 20px; }
.report-notes { border-top: 1px solid var(--line); padding-top: 12px; }
.report-notes h2 { font-family: var(--display); font-size: 16px; margin-bottom: 8px; }
.report-notes ul { list-style: none; padding: 0; }
.report-notes li { font-size: 13px; padding: 4px 0; }
.report-notes .d { color: var(--muted); font-size: 11px; margin-right: 6px; }
.hint { color: var(--muted); font-size: 13px; font-style: italic; }
