/* GrantMatch — house style. Theme-aware, self-contained, no external assets. */
:root {
  --bg: #f7f8fa; --panel: #ffffff; --ink: #1a1f2b; --muted: #66707f;
  --line: #e4e8ee; --brand: #2f5fdf; --brand-ink: #1a3a9e;
  --ok: #1f9d57; --ok-bg: #e7f6ee; --warn: #c47d00; --warn-bg: #fdf3e0;
  --miss: #d23b3b; --miss-bg: #fbe9e9; --unv: #8a6d00; --unv-bg: #fbf6df;
  --radius: 12px; --shadow: 0 1px 3px rgba(20,30,50,.06), 0 6px 20px rgba(20,30,50,.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218; --panel: #171b24; --ink: #e8ecf3; --muted: #97a1b2;
    --line: #262c39; --brand: #6f97ff; --brand-ink: #a9c1ff;
    --ok: #46c980; --ok-bg: #12291d; --warn: #e0a53a; --warn-bg: #2a2110;
    --miss: #f0736f; --miss-bg: #2c1414; --unv: #d8bd52; --unv-bg: #272008;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
h1, h2 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 60px; }

/* header */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto; padding: 20px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 14px; align-items: center; }
.logo {
  font-size: 30px; color: #fff; background: var(--brand); width: 46px; height: 46px;
  display: grid; place-items: center; border-radius: 11px; box-shadow: var(--shadow);
}
.topbar h1 { font-size: 22px; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; max-width: 52ch; }
.tagline em { color: var(--ink); font-style: normal; font-weight: 600; }
.mode { display: flex; gap: 8px; flex-wrap: wrap; }
.mode-opt {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--panel); font-size: 13px; cursor: pointer;
}
.mode-opt .hint { color: var(--muted); font-size: 11.5px; }
.live-config {
  max-width: 1180px; margin: 0 auto; padding: 12px 20px; display: flex; gap: 14px; align-items: center;
  flex-wrap: wrap; background: var(--warn-bg); border-bottom: 1px solid var(--line); font-size: 13px;
}
.live-config input { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink); }
.hint { color: var(--muted); }
code { background: rgba(127,127,127,.14); padding: 1px 5px; border-radius: 5px; font-size: .92em; }

/* thesis banner */
.thesis {
  margin: 20px 0; padding: 14px 18px; border-left: 3px solid var(--brand); background: var(--panel);
  border-radius: 0 var(--radius) var(--radius) 0; box-shadow: var(--shadow); font-size: 14px;
}
.thesis strong { color: var(--brand-ink); }

/* layout */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel h2 { font-size: 15px; margin-top: 20px; }
.panel h2:first-child { margin-top: 0; }
.sub { color: var(--muted); font-size: 13px; margin: 4px 0 8px; }
.count { color: var(--muted); font-weight: 400; font-size: 13px; }
textarea {
  width: 100%; resize: vertical; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg); color: var(--ink); font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
a { color: var(--brand); }

/* buttons */
.actions { display: flex; gap: 10px; margin-top: 14px; }
button { font: inherit; font-weight: 600; border-radius: 9px; padding: 10px 16px; cursor: pointer; border: 1px solid transparent; }
button.primary { background: var(--brand); color: #fff; }
button.primary:disabled { opacity: .6; cursor: default; }
button.ghost { background: transparent; border-color: var(--line); color: var(--ink); }

/* status */
.status { margin: 12px 0 0; font-size: 13px; padding: 8px 11px; border-radius: 8px; }
.status-info { color: var(--muted); background: rgba(127,127,127,.08); }
.status-ok { color: var(--ok); background: var(--ok-bg); }
.status-warn { color: var(--warn); background: var(--warn-bg); }
.status-error { color: var(--miss); background: var(--miss-bg); }

/* scorecard */
.scorecard { display: flex; gap: 20px; align-items: center; padding: 6px 0 4px; }
.score-ring {
  flex: none; width: 108px; height: 108px; border-radius: 50%; display: grid; place-items: center;
  text-align: center; position: relative;
  background: conic-gradient(currentcolor calc(var(--p,0)*1%), var(--line) 0);
}
.score-ring.ok { color: var(--ok); }
.score-ring.warn { color: var(--warn); }
.score-ring::before { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--panel); }
.score-ring > * { position: relative; z-index: 1; }
.score-num { font-size: 26px; font-weight: 700; color: var(--ink); }
.score-lbl { font-size: 10.5px; color: var(--muted); line-height: 1.15; margin-top: 2px; }
.score-detail { flex: 1; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.score-counts { list-style: none; display: flex; gap: 14px; flex-wrap: wrap; padding: 0; margin: 10px 0; font-size: 13px; font-weight: 600; }
.c-met { color: var(--ok); } .c-partial { color: var(--warn); } .c-missing { color: var(--miss); } .c-unverified { color: var(--unv); }
.fab-note { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.fab-note.ok { color: var(--ok); }

/* requirements */
.requirements { display: flex; flex-direction: column; gap: 7px; }
.req { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: baseline; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; }
.req-type { grid-row: span 2; align-self: start; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: rgba(127,127,127,.12); color: var(--muted); }
.type-eligibility { color: var(--brand-ink); background: rgba(47,95,223,.12); }
.type-attachment { color: var(--ok); background: var(--ok-bg); }
.type-deadline, .type-budget { color: var(--warn); background: var(--warn-bg); }
.req-text { font-size: 13.5px; }
.req-mand { color: var(--miss); font-weight: 700; font-size: 11.5px; }
.req-span { grid-column: 2; font-size: 12px; color: var(--muted); font-style: italic; }
.req-span.unverified { color: var(--miss); font-style: normal; font-weight: 600; }

/* compliance table */
.compliance-wrap { overflow-x: auto; }
.ctable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ctable th { text-align: left; color: var(--muted); font-weight: 600; padding: 7px 9px; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.ctable td { padding: 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
.c-status { white-space: nowrap; font-weight: 600; text-transform: capitalize; }
.row-met { background: var(--ok-bg); } .row-partial { background: var(--warn-bg); }
.row-missing { background: var(--miss-bg); } .row-unverified { background: var(--unv-bg); }
.c-evidence q { font-style: italic; }
.c-evidence q.grounded { color: var(--ok); }
.c-evidence q.ungrounded { color: var(--miss); text-decoration: line-through; }
.c-evidence .flag { display: block; font-size: 11px; color: var(--miss); font-weight: 700; margin-top: 2px; }
.muted { color: var(--muted); }

/* prompt peek */
.peek { margin-top: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 18px; }
.peek summary { cursor: pointer; font-weight: 600; padding: 10px 0; font-size: 13.5px; }
.peek pre { overflow-x: auto; font-size: 11.5px; color: var(--muted); background: var(--bg); padding: 12px; border-radius: 8px; }

footer { max-width: 1180px; margin: 0 auto; padding: 24px 20px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
