/* Write On Intelligence: Grant Review.
   Follows the Write On Fundraising site: Roc Grotesk, jade text, flat full-width
   color bands (gold, jade, blush), square corners, magenta-and-gold call to action. */
:root {
  --jade: #0F4F56;
  --jade-deep: #0A3B41;
  --gold: #F2C251;
  --magenta: #C12398;
  --turquoise: #4FC6B7;
  --blush: #FFF7F2;
  --white: #FFFFFF;
  --rule: #C9DADB;       /* jade at low strength, for ruled lines */
  --rule-strong: #0F4F56;
  --muted: #3F6E73;      /* 6.3:1 on white */
  --font: "roc-grotesk", "Archivo", "Helvetica Neue", Arial, sans-serif;
  --wide: "roc-grotesk-wide", "Archivo", "Helvetica Neue", Arial, sans-serif;
  --measure: 78ch;
  --page: 1440px;       /* content width on large screens */
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--white); color: var(--jade);
  font-family: var(--font); font-weight: 500; font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: var(--jade); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--magenta); }
:focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font); font-weight: 700; line-height: 1.08; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 4.4vw, 3.3rem); letter-spacing: -.01em; max-width: 20ch; }
h2 { font-size: 1.55rem; }
p { margin: 0 0 1em; max-width: var(--measure); }
b, strong { font-weight: 700; }
.small { font-size: .92rem; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- navigation ---------- */
.nav { display: flex; align-items: center; gap: 36px; padding: 18px 40px; background: var(--white); flex-wrap: wrap; }
.brand-logo { height: 44px; width: auto; display: block; }
.navlinks { display: flex; flex-wrap: wrap; gap: 4px 26px; }
.navlinks a { text-decoration: none; font-size: 1.02rem; padding: 6px 0; border-bottom: 3px solid transparent; }
.navlinks a:hover { color: var(--jade); border-bottom-color: var(--turquoise); }
.navlinks a[aria-current="page"] { border-bottom-color: var(--magenta); }
.navright { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.navright form { margin: 0; }
.who { text-decoration: none; }

/* ---------- bands and layout ---------- */
.band { width: 100%; }
.band.gold { background: var(--gold); }
.band.jade { background: var(--jade); color: var(--white); }
.band.jade h1, .band.jade h2 { color: var(--gold); }
.band.jade a { color: var(--white); }
.band.blush { background: var(--blush); }
.inner { max-width: var(--page); margin: 0 auto; padding: 56px 40px; }
.inner.page { padding-top: 48px; padding-bottom: 64px; }
.inner.narrow, .page.narrow { max-width: 620px; }
.lede { font-size: 1.22rem; line-height: 1.45; max-width: 64ch; margin-bottom: 0; }
.lede-sm { font-size: 1.08rem; }
.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px; align-items: start; }
.foot { background: var(--jade); color: var(--white); }
.foot p { max-width: var(--page); margin: 0 auto; padding: 22px 40px; font-size: .9rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 0; cursor: pointer; text-decoration: none;
  font-family: var(--wide); font-stretch: 125%; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; font-size: .88rem;
  padding: 16px 28px; min-height: 48px;
}
/* The site's call to action: magenta with gold. Set large so gold-on-magenta meets
   WCAG AA for large text (3.5:1). */
.btn.cta { background: var(--magenta); color: var(--gold); font-size: 1.2rem; font-weight: 700; padding: 18px 34px; }
.btn.cta:hover { background: #A51C82; color: var(--gold); }
.btn.solid { background: var(--jade); color: var(--white); }
.btn.solid:hover { background: var(--jade-deep); color: var(--white); }
.btn.quiet { background: var(--turquoise); color: var(--jade-deep); padding: 10px 18px; min-height: 40px; font-size: .78rem; }
.btn.quiet:hover { background: #3FB5A6; color: var(--jade-deep); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.wide { width: 100%; margin-top: 26px; }
.textlink { background: none; border: 0; padding: 4px 0; min-height: 28px; font: inherit; color: var(--jade); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
.textlink:hover { color: var(--magenta); }
.textlink.danger { color: #9E1C7C; }
.actions { display: flex; gap: 14px; justify-content: flex-end; align-items: center; margin-top: 26px; }
.actions.left { justify-content: flex-start; }
.split-actions { justify-content: space-between; }
.split-actions form { margin: 0; }

/* ---------- forms ---------- */
label, legend { display: block; font-weight: 700; font-size: 1rem; margin: 22px 0 6px; }
.opt { font-weight: 500; color: var(--muted); font-size: .88rem; margin-left: 6px; }
.hint { font-size: .92rem; color: var(--muted); margin: -2px 0 8px; }
input, select, textarea {
  width: 100%; font: inherit; font-weight: 500; font-size: 1rem; color: var(--jade);
  background: var(--white); border: 2px solid var(--jade); border-radius: 0; padding: 12px 14px;
  min-height: 50px;
}
input::placeholder, textarea::placeholder { color: #7A9A9D; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--turquoise); outline-offset: 0; }
input[type="file"] { padding: 12px; background: var(--blush); border-style: dashed; cursor: pointer; }
input[type="file"]::file-selector-button { font-family: var(--wide); font-stretch: 125%; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; border: 0; border-radius: 0; background: var(--jade); color: var(--white); padding: 10px 16px; margin-right: 14px; cursor: pointer; }
textarea { resize: vertical; min-height: 220px; line-height: 1.5; }
fieldset { border: 0; padding: 0; margin: 0; }

.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 64px; }
.step h2 { border-bottom: 3px solid var(--jade); padding-bottom: 10px; margin-bottom: 4px; }
.submitrow { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; gap: 32px; margin-top: 40px; padding-top: 28px; border-top: 3px solid var(--jade); }
.submitrow p { margin: 0; max-width: 56ch; }

.choice { margin-top: 24px; }
.choice legend { margin: 0 0 10px; }
.radio { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 10px; padding: 14px 16px; border: 2px solid var(--jade); font-weight: 500; cursor: pointer; }
.radio input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--magenta); flex: none; }
.radio span { display: block; font-size: .95rem; }
.radio strong { display: block; font-size: 1.02rem; }
.radio:has(input:checked) { background: var(--blush); border-color: var(--magenta); }

.picker { position: relative; }
.picker-list { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; margin: 0; padding: 0; list-style: none; background: var(--white); border: 2px solid var(--jade); border-top: 0; max-height: 330px; overflow: auto; }
.picker-list li { padding: 11px 14px; cursor: pointer; border-top: 1px solid var(--rule); }
.picker-list li strong { display: block; }
.picker-list li span { font-size: .88rem; color: var(--muted); }
.picker-list li:hover, .picker-list li:focus { background: var(--blush); outline: none; }
.picker-list li.none { cursor: default; color: var(--muted); }

/* waiting state */
.working { padding: 40px 0 20px; max-width: 560px; }
.working h2 { font-size: 2rem; }
.progress { height: 10px; background: var(--blush); overflow: hidden; margin-top: 24px; }
.progress i { display: block; width: 35%; height: 100%; background: var(--jade); animation: slide 1.6s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) { .progress i { animation: none; width: 100%; opacity: .35; } }

/* ---------- login ---------- */
.loginbox { background: var(--white); padding: 32px 34px 26px; }
.loginbox h2 { margin-bottom: 0; }
.loginbox .small { margin: 16px 0 0; }

/* ---------- scorecard ---------- */
.back { margin: 0 0 18px; font-size: .95rem; }
.back a::before { content: "\2190\00a0"; }
.gradehead { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: end; }
.gradehead h1 { margin-bottom: .35em; }
.meta { margin: 0; font-size: 1.05rem; color: #D9ECEC; }
.grade { text-align: right; min-width: 210px; }
.grade .got { display: block; font-size: clamp(5rem, 11vw, 8rem); line-height: .85; font-weight: 700; color: var(--gold); letter-spacing: -.03em; }
.grade .of { display: block; font-size: 1.25rem; margin-top: 10px; }
.grade .why-of { display: block; font-size: .85rem; color: #D9ECEC; max-width: 26ch; margin: 8px 0 0 auto; }

.caveat { font-size: .98rem; padding: 0 0 28px; margin: 0 0 32px; border-bottom: 1px solid var(--rule); max-width: none; }
.summary { margin-bottom: 44px; }
.summary p:first-of-type { font-size: 1.22rem; line-height: 1.5; }

/* the rubric sheet: ruled lines, reviewer notes in the right-hand column */
.sheet { overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: collapse; }
.rubric { border-top: 3px solid var(--rule-strong); border-bottom: 3px solid var(--rule-strong); }
.rubric col.c-crit { width: 27%; }
.rubric col.c-score { width: 13%; }
th, td { text-align: left; vertical-align: top; padding: 16px 14px 16px 0; border-bottom: 1px solid var(--rule); }
thead th { font-size: .9rem; font-weight: 700; color: var(--muted); padding-top: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--jade); }
.rubric th[scope="row"] { font-weight: 700; }
.rubric tr.indent th[scope="row"] { padding-left: 22px; font-weight: 500; }
.rubric tr.subhead th, .rubric tr.subhead td { background: var(--blush); padding-top: 12px; padding-bottom: 12px; font-weight: 700; }
.rubric tr.subhead th { padding-left: 12px; }
.score b { font-size: 1.6rem; line-height: 1; }
.score .max { font-size: 1rem; color: var(--muted); margin-left: 2px; }
.score.low b { color: var(--magenta); }
.score .na { color: var(--muted); font-size: .95rem; }
.note { line-height: 1.5; }
/* the client's own corrections, like a second pen on the page */
.pen { display: block; color: var(--magenta); font-style: italic; font-weight: 700; font-size: .95rem; margin-top: 8px; }
.pen.block { font-weight: 600; }

/* funder fit */
.fitband { background: var(--white); border-top: 6px solid var(--gold); }
.fitadd { display: flex; gap: 16px; align-items: flex-end; max-width: 760px; }
.fitadd label { margin-top: 8px; }
.fitwait { max-width: 640px; }
.fithead { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: start; margin-bottom: 8px; }
.verdict { display: inline-block; font-family: var(--wide); font-stretch: 125%; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; font-size: 1.05rem; padding: 8px 14px; margin: 4px 0 14px; background: var(--jade); color: var(--gold); }
.verdict.possible-fit { background: var(--gold); color: var(--jade-deep); }
.verdict.weak-fit { background: var(--magenta); color: var(--white); }
.verdict.cant-tell { background: var(--blush); color: var(--jade); }
.askbox { background: var(--blush); padding: 18px 22px; min-width: 220px; }
.askbox .label-plain { display: block; font-size: .92rem; color: var(--muted); }
.askbox b { display: block; font-size: 2rem; line-height: 1.1; margin: 4px 0 6px; }
.fitcols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; margin-top: 28px; }
.fitcols > div, .fithead > div { min-width: 0; }
#fit, .note, .summary, .doctext { overflow-wrap: anywhere; }
.fitcols h3 { font-size: 1.2rem; border-bottom: 3px solid var(--jade); padding-bottom: 8px; }
.fitcols h4 { font-size: 1rem; margin: 20px 0 6px; }
.fitcols ul, .fitcols ol { margin: 0; padding-left: 1.2em; }
.fitcols li { margin-bottom: 8px; max-width: 60ch; }
.funderfacts dl { display: grid; grid-template-columns: 9.5em 1fr; gap: 10px 16px; margin: 16px 0 0; }
.funderfacts dt { font-weight: 700; }
.funderfacts dd { margin: 0; }
.fitfoot { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--rule); }
.funderfacts h3.spaced { margin-top: 40px; }
.relation { background: var(--blush); padding: 14px 16px; }
.relation b { color: var(--magenta); }
.yearbars { margin: 18px 0 8px; }
.yearbars th, .yearbars td { border: 0; padding: 4px 10px 4px 0; font-size: .92rem; vertical-align: middle; }
.yearbars th { width: 3.2em; font-weight: 700; }
.yearbars .bar { width: 45%; }
.yearbars .bar i { display: block; height: 14px; background: var(--jade); min-width: 2px; }
.yearbars .num { white-space: nowrap; }
.yearbars .num span { color: var(--muted); }
.sources summary { cursor: pointer; font-weight: 700; margin-bottom: 8px; }
.sources ul { margin: 0 0 16px; padding-left: 1.2em; font-size: .95rem; }

/* corrections form */
.correct { margin-top: 10px; }
.overall { display: flex; gap: 24px; align-items: flex-start; }
.overall > div:first-child { min-width: 260px; }
.grow { flex: 1; }
.fixes { margin-top: 32px; border-top: 2px solid var(--jade); }
.fixes summary { cursor: pointer; font-weight: 700; font-size: 1.1rem; padding: 18px 0; }
.fix { border-bottom: 1px solid var(--rule); padding: 4px 0 22px; }
.fix legend { font-size: 1.1rem; margin: 18px 0 0; }
.fix legend span { display: block; font-weight: 500; font-size: .92rem; color: var(--muted); }
.fixrow { display: flex; gap: 24px; }
.fixrow > div:first-child { width: 160px; flex: none; }

.draft { border-top: 2px solid var(--jade); border-bottom: 2px solid var(--jade); }
.draft summary { cursor: pointer; font-weight: 700; padding: 16px 0; }
.doctext { white-space: pre-wrap; background: var(--blush); padding: 24px 28px; max-height: 480px; overflow: auto; font-size: .95rem; margin-bottom: 20px; }

/* ---------- lists ---------- */
.ledger { border-top: 3px solid var(--rule-strong); }
.ledger td.msg { max-width: 360px; }
.ledger .sub { display: block; font-size: .85rem; color: var(--muted); }
tr.off td { color: var(--muted); }
.rowactions { white-space: nowrap; }
.rowactions form { display: inline-block; margin: 0 16px 0 0; }
.rowactions .textlink { padding: 0; min-height: 0; }
.addrow { display: flex; gap: 16px; align-items: flex-end; margin: 24px 0 56px; flex-wrap: wrap; }
.addrow > div { flex: 1; min-width: 180px; }
.page h2[id] { margin-top: 12px; scroll-margin-top: 20px; }
.autosubmit select { padding: 6px 8px; border-width: 1px; font-size: .9rem; }
.jump { display: flex; gap: 22px; margin-top: 24px; flex-wrap: wrap; }
.empty { padding: 20px 0; }

/* ---------- messages and dialog ---------- */
.flashes { max-width: var(--page); margin: 0 auto; padding: 0 40px; }
.flash { padding: 14px 18px; margin: 16px 0; max-width: none; }
.flash.ok { background: var(--turquoise); color: var(--jade-deep); }
.flash.error { background: var(--magenta); color: var(--white); }
.flash.error a { color: var(--white); }
code.secret { font-family: var(--font); font-weight: 700; background: var(--white); color: var(--jade); padding: 2px 8px; user-select: all; }
.dialog { border: 3px solid var(--jade); border-radius: 0; padding: 30px 32px; width: min(540px, calc(100vw - 32px)); color: var(--jade); background: var(--white); }
.dialog::backdrop { background: rgba(10, 59, 65, .55); }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .nav { padding: 14px 16px; gap: 14px; }
  .brand-logo { height: 36px; }
  .navlinks { order: 3; width: 100%; gap: 2px 18px; }
  .navlinks a { white-space: nowrap; }
  .navright { gap: 14px; }
  .inner { padding: 36px 16px; }
  .inner.page { padding-top: 32px; }
  .flashes { padding: 0 16px; }
  .foot p { padding: 18px 16px; }
  .split, .formgrid, .gradehead { grid-template-columns: 1fr; gap: 28px; }
  .grade { text-align: left; }
  .grade .why-of { margin-left: 0; }
  .submitrow { flex-direction: column; align-items: stretch; }
  .overall, .fixrow, .fitadd { flex-direction: column; align-items: stretch; gap: 0; }
  .fitadd .btn { margin-top: 16px; }
  .fithead, .fitcols { grid-template-columns: 1fr; gap: 24px; }
  .funderfacts dl { grid-template-columns: 1fr; gap: 2px; }
  .funderfacts dd { margin-bottom: 10px; }
  .fixrow > div:first-child, .overall > div:first-child { width: auto; min-width: 0; }
  .rubric, .rubric tbody, .rubric tr, .rubric th, .rubric td { display: block; }
  .rubric thead, .rubric colgroup { display: none; }
  .rubric tr { border-bottom: 1px solid var(--rule); padding: 14px 0; }
  .rubric th, .rubric td { border: 0; padding: 2px 0; }
  .rubric tr.indent th[scope="row"] { padding-left: 0; }
  .rubric tr.subhead { padding: 10px 12px; background: var(--blush); }
  .rubric tr.subhead th, .rubric tr.subhead td { padding: 0; background: none; }
  .score { margin: 4px 0 6px; }
  .ledger { min-width: 640px; }
}

/* ---------- verdict, references, proof (added 9/30/2026) ---------- */
.summary p { max-width: none; }
.readiness { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; padding: 16px 20px; margin: 4px 0 20px; }
.readiness-label { margin: 0; font-family: var(--wide); font-stretch: 125%; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 1.05rem; }
.readiness-why { margin: 0; font-size: .95rem; }
.readiness.ready { background: var(--jade); color: var(--white); }
.readiness.ready .readiness-label { color: var(--gold); }
.readiness.close { background: var(--gold); color: var(--jade-deep); }
.readiness.revise { background: var(--magenta); color: var(--white); }
.rules summary { cursor: pointer; font-size: .9rem; color: var(--muted); }
.rules p { margin-top: 6px; }
.vchip { display: inline-block; font-size: .82rem; font-weight: 700; padding: 3px 8px; white-space: nowrap; }
.vchip.ready { background: var(--jade); color: var(--white); }
.vchip.close { background: var(--gold); color: var(--jade-deep); }
.vchip.revise { background: var(--magenta); color: var(--white); }

.ref { margin-top: 10px; }
.ref summary { cursor: pointer; font-size: .9rem; font-weight: 700; color: var(--jade); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ref summary:hover { color: var(--magenta); }
.ref[open] summary { margin-bottom: 8px; }
.ref .missing { background: var(--blush); padding: 10px 12px; margin: 0 0 8px; font-size: .95rem; max-width: none; }
.ref .missing b { color: var(--magenta); }
.ref blockquote { margin: 0 0 8px; padding: 6px 0 6px 14px; border-left: 3px solid var(--turquoise); font-style: italic; font-size: .95rem; }
.ref blockquote.unverified { border-left-color: var(--rule); color: var(--muted); }
.ref .flag { display: block; font-style: normal; font-size: .82rem; color: var(--magenta); margin-top: 4px; }
.ref p { font-size: .95rem; margin-bottom: 8px; }
.proofed li { margin-bottom: 12px; }

.disclaimer { margin-top: 24px; font-size: .9rem; color: var(--muted); max-width: none; }
.disclaimer b { color: var(--jade); }

.sizebars tr.mine th, .sizebars tr.mine .num { color: var(--magenta); font-weight: 700; }
.sizebars tr.mine .bar i { background: var(--magenta); }

.subhead-form { font-size: 1.1rem; margin: 36px 0 0; padding-top: 18px; border-top: 1px solid var(--rule); }
.consent { grid-column: 1 / -1; display: flex; gap: 12px; align-items: flex-start; font-weight: 500; margin: 32px 0 0; }
.consent input { width: 20px; height: 20px; min-height: 0; margin: 3px 0 0; accent-color: var(--magenta); flex: none; }
.consent a { font-weight: 700; }
.foot a { color: var(--white); }
.policy h2 { margin-top: 32px; }
.policy ul { padding-left: 1.2em; max-width: var(--measure); }
.policy li { margin-bottom: 8px; }
.sizebars th { width: 8.5em; white-space: nowrap; }
#extra_links { min-height: 96px; }
.notifyrow { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.notifyrow .small { margin: 0; max-width: 46ch; }
.refrow { display: flex; align-items: flex-start; gap: 10px; }
.refrow .ref { flex: 1; min-width: 0; }
.reflink { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-top: 6px; color: var(--jade); border: 1px solid var(--rule); flex: none; }
.reflink:hover { color: var(--white); background: var(--magenta); border-color: var(--magenta); }
.ref .src { font-size: .88rem; color: var(--muted); margin-bottom: 6px; }

/* ---------- funder fit boxes + reference drawer ---------- */
.fitboxes { list-style: none; padding: 0; margin: 0; }
.fitbox { padding: 14px 16px 12px; margin: 0 0 12px; border: 2px solid; }
.fitbox p { margin: 0 0 8px; max-width: none; }
.fit-yes { background: #E3F0EE; border-color: var(--jade); }
.fit-no { background: #FBEAF4; border-color: var(--magenta); }
.refbtn { background: none; border: 0; padding: 0; font: inherit; font-size: .9rem; font-weight: 700; color: var(--jade); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
.fit-no .refbtn { color: #9E1C7C; }
.refbtn:hover { color: var(--magenta); }

.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; height: 100%; max-height: 100%; width: min(480px, 100vw); max-width: 100vw;
  border: 0; border-left: 6px solid var(--gold); padding: 28px 28px 40px; background: var(--white); color: var(--jade); overflow-y: auto; }
.drawer[open] { animation: drawer-in .22s ease-out; }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .drawer[open] { animation: none; } }
.drawer::backdrop { background: rgba(10, 59, 65, .45); }
.drawer-close { float: right; background: none; border: 0; font: inherit; font-weight: 700; color: var(--jade); cursor: pointer; padding: 4px 0; }
.drawer-close:hover { color: var(--magenta); }
.drawer-kind { display: inline-block; font-family: var(--wide); font-stretch: 125%; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; padding: 5px 10px; margin: 0 0 14px; }
.drawer-kind.fit-yes { background: var(--jade); color: var(--gold); border: 0; }
.drawer-kind.fit-no { background: var(--magenta); color: var(--white); border: 0; }
.drawer h3 { font-size: 1.25rem; line-height: 1.25; margin: 0 0 14px; }
.drawer p { max-width: none; }
.drawer blockquote { margin: 0 0 14px; padding: 8px 0 8px 14px; border-left: 3px solid var(--turquoise); font-style: italic; }
.drawer blockquote.unverified { border-left-color: var(--rule); color: var(--muted); }
.drawer .flag { display: block; font-style: normal; font-size: .82rem; color: var(--magenta); margin-top: 4px; }
.drawer .btn { margin-top: 8px; white-space: normal; text-align: left; }

/* ---------- large screens: use the width, one step up in type ---------- */
@media (min-width: 1500px) {
  body { font-size: 18px; }
  .inner { padding-left: 56px; padding-right: 56px; }
  .formgrid { gap: 0 88px; }
  .fitcols { gap: 72px; }
  .nav { padding-left: 56px; padding-right: 56px; }
}
@media (min-width: 1900px) {
  :root { --page: 1600px; }
  body { font-size: 19px; }
}

/* ---------- ask placement ---------- */
.askbox .asklabel { display: block; font-weight: 700; margin-top: 2px; }
.askbox .askbasis { display: block; font-size: .85rem; color: var(--muted); margin-top: 4px; }
.askbox.tone-ok { background: #E3F0EE; }
.askbox.tone-high, .askbox.tone-low { background: #FBEAF4; }
.askbox.tone-high .asklabel, .askbox.tone-low .asklabel { color: var(--magenta); }
.askdetail { margin: 4px 0 8px; }
.askdetail p { margin-bottom: 8px; }
.askdetail .asknote { font-size: .95rem; background: var(--blush); padding: 10px 14px; max-width: none; }
.comps summary { cursor: pointer; font-weight: 700; font-size: .92rem; margin-bottom: 6px; }

/* ---- Intelligence screens (national nonprofit + funder data) ---- */
.searchrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 8px 0 0; }
.searchrow label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 4px; }
.searchrow input[type=search], .searchrow input[type=number], .searchrow select {
  font: inherit; padding: 10px 12px; border: 2px solid var(--jade); background: var(--white); color: var(--jade); }
.searchrow input[type=search] { min-width: min(420px, 100%); }
.searchrow .grow { flex: 1 1 320px; }
.searchrow .grow input { width: 100%; }
.resultlist { list-style: none; padding: 0; margin: 0; }
.resultlist li { border-bottom: 1px solid var(--rule); padding: 14px 0; }
.resultlist li:first-child { border-top: 2px solid var(--rule-strong); }
.resultlist .rname { font-size: 1.15rem; font-weight: 700; }
.resultlist .rmeta { color: var(--muted); font-size: .95rem; }
.tag { display: inline-block; font-size: .8rem; font-weight: 700; padding: 1px 8px; border: 1.5px solid var(--jade); margin-right: 6px; }
.tag.daf { border-color: var(--magenta); color: var(--magenta); }
.orghead .meta { font-size: 1rem; }
.jumpnav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 18px 0 0; padding: 0; list-style: none; font-weight: 700; }
.section { margin: 44px 0 0; }
.section > h2 { border-bottom: 2px solid var(--rule-strong); padding-bottom: 8px; }
.section .sub { color: var(--muted); }
.twocol { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ledger td.money, .ledger th.money { text-align: right; }
.bars td.bar { width: 40%; }
.bars .bar i { display: block; height: 12px; background: var(--jade); min-width: 2px; }
.bars .bar i.exp { background: var(--turquoise); margin-top: 3px; }
.legend { font-size: .85rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin: 0 4px 0 12px; }
.scroll { max-height: 560px; overflow: auto; }
.emptyline { color: var(--muted); font-style: italic; }
@media (max-width: 900px) { .twocol { grid-template-columns: 1fr; } }
.picker-list li a { display: block; text-decoration: none; margin: -11px -14px; padding: 11px 14px; }
.picker-list li a:hover, .picker-list li a:focus { background: var(--blush); outline: none; color: var(--jade); }
.picker-list li.none { font-size: .92rem; }
.searchrow .picker input { width: 100%; }
.band.gold .meta { color: var(--jade); }  /* the pale default is for the jade band */
.twocol > div, .section > .sheet { min-width: 0; overflow-x: auto; }
@media (max-width: 640px) { .bars td.bar, .bars th:last-child { display: none; } }
/* profile header: one plain-English sentence leads; the facts sit under it as labeled pairs */
.summary-line { font-size: clamp(1.2rem, 2.1vw, 1.55rem); font-weight: 600; line-height: 1.38; max-width: 46ch; margin: 4px 0 22px; }
.facts { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 0; }
.facts > div { min-width: 0; }
.facts dt { font-size: .84rem; font-weight: 700; margin: 0; }
.facts dd { margin: 2px 0 0; }
.results td { vertical-align: top; }
@media (max-width: 760px) { .hide-sm { display: none; } }

/* admin: which tools each person can see */
.tools { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; border: 0; }
.tools legend { font-weight: 700; font-size: .9rem; padding: 0; margin-bottom: 4px; }
.tool { display: inline-flex; align-items: center; gap: 6px; font-size: .92rem; white-space: nowrap; cursor: pointer; }
.tool input { width: 18px; height: 18px; accent-color: var(--jade); }
/* the general "label, legend" rule spaces form fields 22px apart; tool switches sit tight in a row */
.tools label.tool { display: inline-flex; margin: 0; font-weight: 600; font-size: .92rem; }
.tools legend { margin: 0 0 4px; }
.ledger td .tools { min-width: 220px; gap: 2px 14px; }
.tools label.tool input { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; flex: none; }
.ledger td .tools label.tool { padding: 3px 0; }

/* each firm's private layer */
.section.team { background: var(--blush); padding: 22px 24px 26px; margin-top: 32px; }
.section.team > h2 { border-bottom-color: var(--magenta); }
.teamtag { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--magenta); border: 1.5px solid var(--magenta); padding: 0 6px; margin-left: 4px; vertical-align: 1px; }
.status-chip { display: inline-block; font-weight: 700; font-size: .9rem; background: var(--jade); color: var(--white); padding: 2px 10px; }
.notes { list-style: none; margin: 14px 0 0; padding: 0; }
.notes li { border-top: 1px solid var(--rule); padding: 10px 0; }
.notes li p { margin: 0 0 4px; white-space: pre-wrap; }
form.inline { display: inline; margin-left: 8px; }
.inline-form select { max-width: 260px; }
tr.left-row td:first-child a { text-decoration: line-through; }
tr.team-row td { background: var(--blush); }
.people-edit { margin-top: 14px; }
.people-edit summary { cursor: pointer; font-weight: 700; }
select.compact { min-height: 0; padding: 6px 8px; font-size: .9rem; width: auto; }
.section.team textarea { min-height: 0; height: 6.5em; }

/* ---- charts (charts.py; colors validated, see DESIGN.md section 2) ---- */
:root {
  --series-1: #04919E; --series-2: #B38C2B; --series-3: #8D106F;
  --ramp-1: #7ABEC7; --ramp-2: #4DA1AB; --ramp-3: #1F838E; --ramp-4: #026771; --ramp-5: #0D4E55;
  --gridline: #E4EBEB; --deemph: #C3CFD0; --empty: #F1F4F4;
}
.viz { margin: 18px 0 26px; }
.viz figcaption { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.viz-svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz-svg text { font-family: var(--font); }
.viz-svg .grid { stroke: var(--gridline); stroke-width: 1; }
.viz-svg .tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.viz-svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-svg .area { opacity: .10; }
.viz-svg .dot { stroke: #FFFFFF; stroke-width: 2; }
.viz-svg .endlabel, .viz-svg .caplabel, .viz-svg .tiplabel { fill: var(--jade); font-size: 12.5px; font-weight: 700; }
.viz-svg .rowlabel { fill: var(--jade); font-size: 13px; }
.viz-svg a .rowlabel { text-decoration: underline; }
.viz-svg .hit { fill: transparent; }
.viz-svg .crosshair { stroke: var(--jade); stroke-width: 1; opacity: 0; }
.viz-svg .vband:hover .crosshair, .viz-svg .vband:focus .crosshair { opacity: .5; }
.viz-svg .mark:hover .fill, .viz-svg .mark:focus .fill { filter: brightness(1.12); }
.viz-svg .mark:focus, .viz-svg .vband:focus { outline: none; }
.viz-svg .mark:focus .fill { stroke: var(--magenta); stroke-width: 2; }
.viz-svg .tile text { font-size: 13px; font-weight: 700; pointer-events: none; }
.viz-svg .tile.empty rect { fill: var(--empty); }
.viz-svg .tile.empty text { fill: #9DB2B4; font-weight: 500; }
.viz-svg .vset { fill-opacity: .14; stroke-width: 2; }
.viz-svg .regioncount { fill: var(--jade); font-size: 20px; font-weight: 700; }
.viz-svg .cellcount { font-size: 14px; font-weight: 700; fill: var(--jade); }
.viz-svg .diag { fill: var(--blush); stroke: var(--rule); }
.viz-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 6px; padding: 0; font-size: .9rem; color: var(--muted); }
.viz-legend .key { display: inline-block; vertical-align: middle; margin-right: 6px; }
.viz-legend .key.rect { width: 12px; height: 12px; border-radius: 2px; }
.viz-legend .key.line { width: 16px; height: 3px; border-radius: 2px; }
.viz-note { font-size: .88rem; color: var(--muted); margin: 6px 0 0; }
.tableview { margin-top: 6px; font-size: .9rem; }
.tableview summary { cursor: pointer; color: var(--muted); }
.tableview .ledger { margin-top: 8px; }
.viz-tip { position: absolute; z-index: 50; background: #FFFFFF; border: 1px solid var(--rule); box-shadow: 0 2px 10px rgba(15,79,86,.12);
  padding: 8px 10px; font-size: .88rem; color: var(--jade); pointer-events: none; max-width: 300px; }
.viz-tip-title { font-weight: 700; margin-bottom: 4px; }
.viz-tip-row b { font-variant-numeric: tabular-nums; }
.viz-tip-row span { color: var(--muted); }
.viz-tip-key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.chartgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 40px; }
@media (max-width: 900px) { .chartgrid { grid-template-columns: 1fr; } }

.pickers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 18px; align-items: end; }
.pickers label { font-size: .85rem; margin: 10px 0 4px; }
.pickers .actions { grid-column: 1 / -1; }
.jumpnav.modes a[aria-current="page"] { text-decoration-color: var(--magenta); }
/* narrow screens: any data table scrolls inside itself instead of pushing the page sideways */
@media (max-width: 760px) { .page :not(.sheet) > table.ledger { min-width: 0; display: block; overflow-x: auto; max-width: 100%; } }

/* side-by-side charts get a hairline between them so they never read as one chart */
.chartgrid > div + div { border-left: 1px solid var(--rule); padding-left: 40px; }
.chartgrid { gap: 8px 40px; }
@media (max-width: 900px) { .chartgrid > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 8px; } }

/* how sure a board-name match is (returns carry only names) */
.match { padding: 6px 0; border-top: 1px solid var(--rule); }
.match:first-child { border-top: 0; padding-top: 0; }
.sure { display: inline-block; font-size: .78rem; font-weight: 700; padding: 0 6px; margin-left: 6px; border: 1.5px solid currentColor; }
.sure.strong { color: var(--jade); }
.sure.likely { color: var(--muted); border-style: dotted; }
.verdicts { margin-left: 0; }
.verdicts .textlink { font-size: .88rem; margin-right: 10px; }
.state-group { margin-top: 26px; }

.connections { max-height: 640px; overflow-y: auto; }
.connections .match { border-top: 0; padding: 6px 0 0 14px; border-left: 3px solid var(--rule); margin-top: 6px; }

/* Find funders */
.checkline { display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: .9rem; min-height: 50px; margin: 0; }
.checkline input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--magenta); }
.prospects .prospect { padding: 18px 0; }
.phead { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.ptag { display: inline-block; font-size: .78rem; font-weight: 700; padding: 0 6px; border: 1.5px solid var(--muted); color: var(--muted); }
.ptag.invite { border-color: var(--magenta); color: var(--magenta); }
.ptag.warm { background: var(--jade); border-color: var(--jade); color: var(--white); }
.prospect .why { margin: 8px 0 6px; }
.pfacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 24px; margin: 6px 0 4px; }
.pfacts dt { font-size: .8rem; font-weight: 700; color: var(--muted); }
.pfacts dd { margin: 0; font-weight: 600; }
.staleline { color: var(--magenta); margin: 4px 0; }
/* ranked list: the number is the rank */
.prospects .prospect { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 16px; }
.prospects .rank { font-family: var(--wide); font-stretch: 125%; font-weight: 800; font-size: 1.05rem; color: var(--jade);
  font-variant-numeric: tabular-nums; padding-top: 4px; text-align: right; }
.prospects .pbody { min-width: 0; }
.pfacts dd { font-variant-numeric: tabular-nums; }
.wpaths { margin-top: 10px; background: var(--blush); padding: 10px 14px; }
.wpath + .wpath, .more-paths .wpath { border-top: 1px solid var(--rule); padding-top: 8px; margin-top: 8px; }
.more-paths > summary { cursor: pointer; font-weight: 700; font-size: .9rem; margin-top: 6px; }
.prospect form.inline { margin-top: 12px; }
@media (max-width: 560px) { .prospects .prospect { grid-template-columns: 28px minmax(0, 1fr); gap: 0 10px; } }
/* browser surfaces in the palette */
::selection { background: var(--gold); color: var(--jade); }
html { accent-color: var(--jade); caret-color: var(--jade); }
.apply { margin-top: 8px; }
.apply summary, .more > summary { cursor: pointer; font-weight: 700; }
.apply dl { margin: 6px 0 0; }
.apply dt { font-size: .8rem; font-weight: 700; color: var(--muted); margin-top: 6px; }
.apply dd { margin: 0; }
.more { margin-top: 14px; }
.method li { margin-bottom: 8px; max-width: 80ch; }

/* a row of headline figures, ruled like the rest of the page */
.statrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; margin: 8px 0 24px; border-top: 2px solid var(--rule-strong); border-bottom: 1px solid var(--rule); }
.statrow > div { padding: 16px 20px 18px 0; min-width: 0; }
.statrow > div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.statrow dt { font-size: .84rem; font-weight: 700; color: var(--muted); margin: 0; }
.statrow dd { margin: 4px 0 0; font-size: 1.75rem; font-weight: 700; color: var(--jade); font-variant-numeric: tabular-nums; }
.actionrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 28px; }
.actionrow .small { max-width: 60ch; }
/* bar charts keep a readable size instead of stretching across wide pages */
.viz-svg.bars { max-width: 820px; }
@media (max-width: 560px) { .statrow > div + div { border-left: 0; padding-left: 0; } .statrow > div { border-bottom: 1px solid var(--rule); } }

.btn.manual { background: var(--magenta); color: var(--white); padding: 10px 18px; min-height: 40px; font-size: .78rem; text-decoration: none; }
.btn.manual:hover { background: #A51C82; color: var(--white); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.csvlink { text-decoration: none; }

/* tasks and deadlines */
.tasks { margin-top: 28px; }
.tasklist { list-style: none; margin: 0 0 14px; padding: 0; }
.tasklist li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.tasklist .tick { width: 22px; height: 22px; min-height: 0; padding: 0; border: 2px solid var(--jade); background: var(--white); color: var(--jade); font-weight: 800; line-height: 1; cursor: pointer; }
.tasklist .tick:hover { background: var(--blush); }
.tasklist .ttitle { font-weight: 600; }
.tasklist li.done .ttitle { text-decoration: line-through; color: var(--muted); }
.tasklist li.overdue .due { color: var(--magenta); font-weight: 700; }
.tasklist li.soon .due { font-weight: 700; }
.taskrow { display: flex; flex-wrap: wrap; gap: 12px; }
.taskrow > div { flex: 1 1 160px; min-width: 0; }
.upcoming { margin-top: 8px; }
.duegroup { font-size: 1rem; margin: 18px 0 4px; display: flex; gap: 8px; align-items: baseline; }
.duegroup.overdue { color: var(--magenta); }
.duegroup .count { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.tracked-h { margin-top: 36px; }

/* peer benchmark: where this organization sits among its peers */
.bench .rankbar { display: inline-block; width: 90px; height: 8px; background: var(--empty); vertical-align: middle; margin-right: 8px; }
.bench .rankbar span { display: block; height: 100%; background: var(--series-1); }
.bench td { font-variant-numeric: tabular-nums; }

#deadlines .tasklist li { grid-template-columns: 110px minmax(0, 1fr) auto; }

.dl-src { color: var(--muted); }
.dl-src.ok { color: var(--jade); }
.dl-src.warn { color: var(--magenta); font-weight: 600; }
.dl-src + form { margin-left: 6px; }
