/* Boulder Civic Map: a private explorer. Grayscale-first: meaning is carried by shape, weight,
   pattern and words, never by colour alone. */
@font-face { font-family: "Public Sans"; src: url(fonts/public-sans.woff2) format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url(fonts/public-sans-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(fonts/plex-mono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(fonts/plex-mono-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --paper: #f3f4f1;
  --card: #fbfbf9;
  --ink: #121614;
  --muted: #545b57;
  --line: #c6cbc5;
  --accent: #1e5b47;
  --accent-ink: #ffffff;
  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gutter: clamp(16px, 3vw, 40px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --paper: #111412; --card: #181c19; --ink: #e8ebe7; --muted: #a2a9a4; --line: #353c37;
    --accent: #7cc4a6; --accent-ink: #0d120f; color-scheme: dark;
  }
}
:root[data-theme=dark] {
  --paper: #111412; --card: #181c19; --ink: #e8ebe7; --muted: #a2a9a4; --line: #353c37;
  --accent: #7cc4a6; --accent-ink: #0d120f; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.5 var(--sans); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; line-height: 1.1; margin: 0; }
h1 { font-weight: 900; font-size: clamp(32px, 4.4vw, 60px); letter-spacing: -0.02em; }
h2 { font-weight: 800; font-size: clamp(22px, 2.2vw, 30px); letter-spacing: -0.01em; }
h3 { font-weight: 700; font-size: 19px; }
p { margin: 0; max-width: 72ch; }
.mono, code, time { font-family: var(--mono); font-size: 0.86em; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.eyebrow { font: 700 12px/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* Masthead */
.mast { border-bottom: 3px solid var(--ink); background: var(--paper); }
.mast-in { max-width: 1480px; margin: 0 auto; padding: 12px var(--gutter); display: flex; gap: 18px 28px; align-items: baseline; flex-wrap: wrap; }
.mark { font-weight: 900; font-size: 20px; letter-spacing: 0.02em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.mark span { font-weight: 400; }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; font-weight: 700; font-size: 15px; }
.nav a { text-decoration: none; padding: 6px 0; border-bottom: 3px solid transparent; }
.nav a[aria-current=page] { border-bottom-color: var(--ink); }
.asof { margin-left: auto; white-space: nowrap; font: 400 13px var(--mono); color: var(--muted); }

main { max-width: 1480px; margin: 0 auto; padding: 28px var(--gutter) 40px; display: grid; gap: 36px; }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.lede { font-size: 19px; max-width: 70ch; }
.head { display: grid; gap: 12px; }

section { display: grid; gap: 14px; }
.rule { border-top: 1px solid var(--line); padding-top: 22px; }
.sechead { display: flex; gap: 10px 16px; align-items: baseline; flex-wrap: wrap; }

/* Provenance labels: three looks that differ in grayscale. */
.prov { display: inline-block; font: 600 11px/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 6px 3px; border: 1.5px solid var(--ink); border-radius: 2px; white-space: nowrap; vertical-align: 2px; text-decoration: none; }
.prov[data-p=derived] { border-style: dashed; }
.prov[data-p=ai-read-unreviewed] { background: var(--ink); color: var(--paper); }
.prov[data-p=explorer] { border-style: dotted; color: var(--muted); border-color: var(--muted); }
.src { font: 600 13px var(--mono); white-space: nowrap; }
.src::after { content: " ↗"; }

/* Civic map: two layouts drawn by civic_map.py (wide, narrow), one shown per screen; map.js changes what shows.
   Every map label is Plex Mono, so the layout knows its exact width. */
.head.compact { gap: 6px; }
.head.compact h1 { font-size: clamp(26px, 2.4vw, 34px); }
.head.compact .lede { font-size: 16px; color: var(--muted); max-width: 100ch; }
.mapwrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto 1fr; grid-template-areas: "map tools" "map side"; gap: 14px 28px; align-items: start; }
.maptools { grid-area: tools; display: grid; gap: 6px; }
.mapcanvas { grid-area: map; min-width: 0; }
.mapside { grid-area: side; position: sticky; top: 8px; max-height: calc(100vh - 16px); overflow-y: auto; background: var(--card); border: 1px solid var(--line); padding: 16px 18px; }
.togs, .focusbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.togs[hidden], .focusbar[hidden] { display: none; }
.togs .eyebrow { min-width: 5ch; }
.tog { font: 600 14px var(--sans); min-height: 44px; padding: 6px 12px; display: inline-flex; gap: 8px; align-items: center; background: transparent; color: var(--ink); border: 1.5px solid var(--line); border-radius: 22px; }
.tog svg { color: var(--ink); flex: none; }
.tog .n { font: 400 12px var(--mono); color: var(--muted); }
.tog[aria-pressed=true] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.tog[aria-pressed=true] svg, .tog[aria-pressed=true] .n { color: var(--paper); }
.tog[aria-pressed=true] svg line[stroke^="#"] { stroke: var(--paper); }
.focusbar .focusname { font: 800 18px var(--sans); }
.focusbar .todetail { margin-left: auto; display: none; }
.maphint { font-size: 14px; color: var(--muted); }
.maphint[hidden] { display: none; }
.map { width: 100%; height: auto; display: block; }
.map.narrow { display: none; }
@media (max-width: 760px) { .map.wide { display: none; } .map.narrow { display: block; } }
.map text { text-rendering: geometricPrecision; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; dominant-baseline: central; }
.map .mlbl { font: 400 13px var(--mono); fill: var(--ink); }
.map .mhub { font: 600 14px var(--mono); fill: var(--ink); }
.map .mpill { font: 400 12px var(--mono); fill: var(--ink); stroke-width: 0; }
.map .mhead { font: 600 11px var(--mono); letter-spacing: 0.06em; fill: var(--muted); }
.map .mtitle { font: 600 14px var(--mono); letter-spacing: 0.06em; fill: var(--ink); }
.map .msub { font: 400 12px var(--mono); fill: var(--muted); }
.map .mverb { font: 400 11px var(--mono); fill: var(--muted); }
.map .off { display: none; }
.map .nd { cursor: pointer; }
.map .nd:hover .node, .map .nd:focus-within .node, .map .nd:focus .node { stroke-width: 4; }
.map .nd:hover .mlbl, .map .nd:focus-within .mlbl { text-decoration: underline; }
.map .nd:focus { outline: none; }
.map .nd:focus-visible .hit, .map .nd a:focus-visible .hit { stroke: var(--ink); stroke-width: 2; }
.map .edges .rel path { stroke-opacity: 0.5; }
.map .edges .rel:hover path { stroke-opacity: 1; stroke-width: 3; }
.map .egorel path { stroke-opacity: 0.85; }
.map .ego .center .node { stroke-width: 4; }
.map.focused .edges, .map.focused .nodes { opacity: 0.05; pointer-events: none; }
.map .ego text.mhead { fill: var(--ink); }
.mapside .legend, .focuspanel { display: grid; gap: 10px; font-size: 14px; }
.legend[hidden], .focuspanel[hidden] { display: none; }
.legend svg { flex: none; }
.legend .row { display: flex; gap: 10px; align-items: center; }
.legend h3 { font-size: 15px; margin-top: 6px; }
.focuspanel h2 { font-size: 24px; }
.focuspanel .fpage { font-weight: 700; }
.focuspanel .gov > .sechead h2, .focuspanel .roster-sec h2 { font-size: 17px; }
.focuspanel .facts { grid-template-columns: minmax(0, 1fr); }
.focuspanel .facts dt { font-weight: 700; color: var(--ink); margin-top: 6px; }
.focuspanel section { gap: 8px; }
.focuspanel .roster { columns: 1; }
@media (prefers-reduced-motion: no-preference) {
  .map .nodes, .map .edges { transition: opacity .35s ease; }
  .map .nodes > .nd, .map .nodes > .row { transition: transform .35s ease; }
  .map .ego .nd { transition: transform .5s cubic-bezier(.3, .7, .3, 1), opacity .4s ease; }
  .map .egoedges { transition: opacity .35s ease .3s; }
}
@media (max-width: 1100px) {
  .mapwrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "tools" "map" "side"; }
  .mapside { position: static; max-height: none; }
  .focusbar .todetail { display: inline-flex; }
}
@media (max-width: 760px) {
  /* the toggles scroll sideways in their own strip; the page never does */
  .togs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
  .togs > * { flex: none; }
  .head.compact .lede { font-size: 14px; }
}

/* Body cards on the map page */
.kindgroup { display: grid; gap: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); padding: 14px 16px; display: grid; gap: 8px; align-content: start; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card .abbr { font: 600 13px var(--mono); color: var(--muted); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 14px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.counts { display: flex; flex-wrap: wrap; gap: 4px 14px; font: 400 13px var(--mono); }
.counts b { font-weight: 600; }
.missing { font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; }
.missing span { border: 1px dashed var(--muted); padding: 1px 6px; color: var(--muted); }
.missing span::before { content: "no "; }

/* Timelines and bars */
.tl { width: 100%; height: auto; display: block; }
.tl text { font: 400 13px var(--mono); fill: var(--muted); }
.tl .yl { font-weight: 600; fill: var(--ink); }
.tlscroll { overflow-x: auto; }
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: minmax(120px, 260px) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 15px; }
.bar .track { height: 16px; background: transparent; border: 1px solid var(--line); }
.bar .fill { height: 100%; background: var(--ink); }
.bar .fill.alt { background: repeating-linear-gradient(135deg, var(--ink) 0 3px, transparent 3px 6px); }
.bar .n { font: 600 14px var(--mono); min-width: 7ch; text-align: right; }
.bar a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Lists of meetings, documents, mentions */
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list > li { border-top: 1px solid var(--line); padding: 10px 0; display: grid; gap: 4px; }
.mrow { display: grid; grid-template-columns: 11ch minmax(0, 1fr) auto; gap: 4px 14px; align-items: baseline; }
.mrow .what { min-width: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 4px 10px; font: 400 13px var(--mono); color: var(--muted); }
.tags .has { color: var(--ink); font-weight: 600; }
.quote { font-size: 17px; max-width: 70ch; }
.quote::before { content: "“"; } .quote::after { content: "”"; }
details { border-top: 1px solid var(--line); }
details > summary { cursor: pointer; padding: 10px 0; font-weight: 700; list-style-position: inside; }
details > summary .muted { font-weight: 400; }

/* A transcript: closed until opened, one caption segment per line, its time a link to that moment */
details.captions { margin-top: 8px; }
details.captions > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
details.captions > summary { list-style: none; }
details.captions > summary::-webkit-details-marker { display: none; }
details.captions > summary::before { content: "\25B8"; }
details.captions[open] > summary::before { content: "\25BE"; }
.segs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 15px; max-width: 80ch; }
.segs li { display: grid; grid-template-columns: 7ch minmax(0, 1fr); gap: 10px; overflow-wrap: anywhere; }
.segs .ts { font: 400 13px/1.9 var(--mono); }
/* A meeting summary, written by a model */
.summary { border: 2px solid var(--ink); padding: 14px 16px; margin: 0 0 30px; max-width: 90ch; }
.summary h3 { margin: 14px 0 4px; }
.items { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.items ol { list-style: none; padding-left: 26px; margin: 6px 0 0; display: grid; gap: 4px; }
.items .no { font: 600 13px var(--mono); margin-right: 8px; }
.two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.roster { columns: 2 260px; column-gap: 28px; list-style: none; padding: 0; margin: 0; }
.roster li { break-inside: avoid; padding: 4px 0; font-size: 15px; }
.purpose { white-space: pre-line; max-width: 72ch; }
.panel { background: var(--card); border: 1px solid var(--line); padding: 16px 18px; display: grid; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--ink); padding: 2px 8px; font-size: 14px; text-decoration: none; white-space: nowrap; }
.chip:hover { background: var(--ink); color: var(--paper); }
.chip .n { font: 600 12px var(--mono); margin-left: 4px; }
.placeholder { border: 2px dashed var(--ink); padding: 16px 18px; display: grid; gap: 8px; }

/* Rendered markdown (GAPS, reads) */
.md { display: grid; gap: 12px; max-width: 100%; }
.md h1 { font-size: 34px; } .md h2 { font-size: 24px; margin-top: 14px; } .md h3 { font-size: 18px; }
.md ul { margin: 0; padding-left: 22px; display: grid; gap: 6px; max-width: 80ch; }
.md blockquote { margin: 0; padding: 10px 14px; border: 2px solid var(--ink); max-width: 80ch; }
.md pre { overflow-x: auto; background: var(--card); border: 1px solid var(--line); padding: 10px; font-size: 13px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); }
table { border-collapse: collapse; font-size: 14px; width: 100%; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { font-weight: 700; background: var(--card); }
.md td { min-width: 14ch; }
.md td:last-child { min-width: 28ch; }

/* Note box (the private build only) */
.note { max-width: 1480px; margin: 0 auto 40px; padding: 0 var(--gutter); }
.note-in { border: 3px solid var(--ink); background: var(--card); padding: 14px 16px; display: grid; gap: 10px; }
.note label { font-weight: 800; font-size: 17px; }
.note textarea { width: 100%; min-height: 84px; font: 400 16px/1.45 var(--sans); padding: 10px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); resize: vertical; }
.note .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
button { font: 700 15px var(--sans); padding: 10px 16px; min-height: 44px; border: 2px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; }
button.ghost { background: transparent; color: var(--ink); }
.status { font: 400 13px var(--mono); color: var(--muted); }
#export-out { display: none; }
#export-out.show { display: block; min-height: 200px; }
.notelist { display: grid; gap: 12px; }
.notelist article { border-top: 1px solid var(--line); padding-top: 10px; white-space: pre-wrap; }

@media (max-width: 1100px) {
  .two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .asof { margin-left: 0; width: 100%; white-space: normal; }
  .mast-in { padding-top: 8px; padding-bottom: 8px; gap: 6px 20px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .bar { grid-template-columns: minmax(0, 1fr) auto; }
  .bar .track { grid-column: 1 / -1; grid-row: 2; }
  .mrow { grid-template-columns: minmax(0, 1fr); }
  .mrow .tags { justify-content: flex-start; }
}
@media (prefers-reduced-motion: no-preference) {
  .bar .fill { transition: width .2s; }
}

/* governance layer: facts and relations read as sentences, sources inline */
.gov .list li, .gov .list li a { display: inline; }
.gov .list li { display: list-item; margin: 4px 0; }
.gov dd .list li { display: block; }

/* departments: their pages and budget charts */
.budget { display: block; max-width: 100%; height: auto; margin: 8px 0 4px; }
.budget .bval { font: 600 12px var(--mono); fill: var(--ink); }
.budget .byear { font: 12px var(--mono); fill: var(--muted); }
.btable, .dtable { border-collapse: collapse; width: 100%; font-size: 14px; }
.btable th, .btable td, .dtable th, .dtable td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.btable td.num, .dtable td.num { font-family: var(--mono); white-space: nowrap; }
.divs li, .svcs li { margin-bottom: 6px; }
