@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap");

:root {
  --page: #faf8f5;
  --surface: #ffffff;
  --hover: #f3f0ea;
  --ink: #2c2824;
  --ink-2: #4a4540;
  --muted: #7a746c;
  --faint: #a09888;
  --accent: #4d8a78;
  --accent-subtle: #e8f2ee;
  --halo: #d7e2dc;
  --line: #d9d3ca;
  --line-2: #e8e3db;
  --add-bg: rgba(46, 160, 67, 0.09);
  --add: #1a7f37;
  --del-bg: rgba(248, 81, 73, 0.09);
  --del: #cf222e;
  --mono: "JetBrains Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 14px/1.5 var(--mono); font-feature-settings: "calt" 0; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-weight: 500; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: 13px; color: var(--muted); margin: 36px 0 10px; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 12px; }
.faint { color: var(--faint); }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 24px; }
main.wrap { padding-top: 24px; padding-bottom: 64px; }

/* Top bar */
.top { background: var(--page); border-bottom: 1px solid var(--line-2); }
.top .wrap { height: 56px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 6px; font-size: 22px; font-weight: 500; letter-spacing: -0.04em; }
.brand:hover { text-decoration: none; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs a:last-child, .crumbs span:last-child { color: var(--ink); }
.sep { color: var(--faint); }

.head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.title { font-size: 22px; }
.tag { padding: 0 6px; font-size: 11px; color: var(--muted); border: 1px solid var(--line); }
.meta { font-size: 12px; color: var(--muted); }
.meta a, .who a { color: var(--ink-2); }
.meta.line { margin: 6px 0 16px; }
.agent { color: var(--accent); }
.prose { white-space: pre-wrap; word-break: break-word; color: var(--ink-2); margin: 8px 0; max-width: 90ch; }
.empty { padding: 18px 14px; color: var(--muted); background: var(--surface); border: 1px solid var(--line-2); }

/* States */
.state { font-size: 11px; padding: 0 6px; border: 1px solid currentColor; }
.state.proposed { color: var(--accent); }
.state.idea, .state.draft { color: var(--muted); }
.state.landed { color: #6b4fa0; }
.state.declined, .state.withdrawn { color: #a05050; }
.behind { color: #a05050; }

/* Signing in and deciding */
.account { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 12px; }
.account button, .decide button, .say button, .grant button, #grants .row button { font: inherit; font-size: 12px; padding: 4px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.account button { padding: 2px 8px; color: var(--muted); }
button:hover { border-color: var(--ink); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #3d7a68; }
.decide { display: flex; gap: 8px; margin: 4px 0 12px; }
.error { border: 1px solid #a05050; color: #a05050; background: #f5e8e8; padding: 8px 12px; margin: 8px 0; font-size: 12px; }
.say { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.say textarea { font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); background: var(--surface); resize: vertical; }
.say button { align-self: flex-start; }

/* Tiles: one hairline between every tile. */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); margin-top: 20px; }
.tile { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 168px; padding: 18px 20px; background: var(--surface); }
.tile:hover { background: var(--hover); text-decoration: none; }
.tile-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tile-title { min-width: 0; }
.tile-owner { font-size: 12px; color: var(--faint); }
.tile-name { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 500; letter-spacing: -0.02em; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile:hover .tile-name { text-decoration: underline; }
.tile-desc { font-size: 13px; color: var(--ink-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile-meta { display: flex; gap: 14px; margin-top: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.tile-open { color: var(--ink-2); }
.icon { flex: none; display: block; }
img.icon { object-fit: contain; }
.lede { color: var(--ink-2); max-width: 80ch; margin: 0 0 4px; }

/* A project */
.project-head { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.project-head .owner { font-size: 13px; color: var(--muted); }
.project-head .title { font-size: 28px; display: flex; align-items: center; gap: 10px; }
.lede { font-size: 15px; color: var(--ink-2); max-width: 80ch; margin: 16px 0 0; line-height: 1.6; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 16px 0 8px; font-size: 13px; color: var(--muted); }
.facts a { color: var(--ink-2); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.activity { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--faint); margin: 28px 0 8px; }
.heat { display: grid; grid-template-columns: repeat(84, 6px); gap: 2px; }
.heat i { width: 6px; height: 6px; background: var(--line-2); }
.heat .h1 { background: #cfe2da; }
.heat .h2 { background: #9cc4b5; }
.heat .h3 { background: #6fa592; }
.heat .h4 { background: var(--accent); }
@media (max-width: 900px) { .activity { display: none; } }

/* Lists */
.list { background: var(--surface); border: 1px solid var(--line-2); }
.list > * { border-top: 1px solid var(--line-2); }
.list > *:first-child { border-top: 0; }
.list .empty { border: 0; }
.row { display: flex; gap: 16px; padding: 12px 16px; align-items: baseline; }
.row .side { flex: none; white-space: nowrap; }
@media (max-width: 700px) { .row { flex-wrap: wrap; } .row .side { width: 100%; } }
.row .n { color: var(--faint); min-width: 4ch; font-size: 12px; }
.pager { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0; font-size: 15px; }
.pager a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); background: var(--surface); }
.pager a:hover { border-color: var(--ink); text-decoration: none; }
.pager .count { color: var(--muted); }
.grow { flex: 1; min-width: 0; }
.msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree a { display: flex; gap: 8px; padding: 6px 12px; }
.tree a:hover { background: var(--hover); text-decoration: none; }
.tree .icon { width: 1ch; color: var(--faint); }
.tree .dir { color: var(--accent); }

/* A change */
.revs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 16px 0 8px; }
.revs a { padding: 2px 8px; border: 1px solid var(--line); background: var(--surface); }
.revs a.on { border-color: var(--ink); }
.revs .meta { margin-left: 8px; }
.steps { font-size: 12px; color: var(--ink-2); border-left: 2px solid var(--line); padding-left: 10px; margin: 8px 0; }
.evidence { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.evidence figure { margin: 0; background: var(--surface); border: 1px solid var(--line-2); padding: 10px; min-width: 0; }
.evidence figcaption { font-size: 12px; margin-bottom: 8px; }
.evidence img { max-width: 100%; display: block; }
.timeline { display: flex; flex-direction: column; gap: 6px; }
.event { font-size: 12px; color: var(--muted); }
.said { background: var(--surface); border: 1px solid var(--line-2); padding: 10px 12px; }
.said .prose { margin: 4px 0 0; color: var(--ink); }

/* Diffs and files */
.filelist { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); margin-bottom: 12px; font-size: 12px; }
.filelist a { display: flex; gap: 8px; padding: 5px 10px; background: var(--surface); min-width: 0; }
.filelist .path { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { width: 1ch; }
.status.added { color: var(--add); }
.status.deleted { color: var(--del); }
.status.modified { color: var(--muted); }
.add { color: var(--add); }
.del { color: var(--del); }
.file { background: var(--surface); border: 1px solid var(--line-2); margin-bottom: 12px; }
.file summary { display: flex; gap: 10px; padding: 7px 12px; cursor: pointer; font-size: 12px; border-bottom: 1px solid var(--line-2); }
.file summary .path { flex: 1; color: var(--ink); }
table.diff { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.55; }
table.diff td { padding: 0 8px; vertical-align: top; }
table.diff .ln { width: 1%; min-width: 4ch; text-align: right; color: var(--faint); user-select: none; }
table.diff .code { white-space: pre-wrap; word-break: break-all; }
table.diff tr.add { background: var(--add-bg); }
table.diff tr.del { background: var(--del-bg); }
table.diff tr.gap td { height: 10px; background: var(--page); }
table.source { background: var(--surface); border: 1px solid var(--line-2); }
.image { padding: 12px; background: var(--surface); border: 1px solid var(--line-2); }
.image img { max-width: 100%; display: block; }
.path-trail { font-size: 16px; display: flex; gap: 6px; flex-wrap: wrap; }
.path-trail a:last-child { color: var(--ink); font-weight: 500; }

@media (max-width: 640px) { .wrap { padding: 0 14px; } }
#grants .row form { margin-left: 8px; }
.grant { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.grant select, .grant input { font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.grant input { flex: 1; min-width: 200px; }
