:root {
  --ink: #14212b; --muted: #5b6b78; --line: #d9e0e5; --paper: #fff; --wash: #f4f6f8;
  --teal: #0d9488; --sky: #0ea5e9; --grad: linear-gradient(90deg, var(--teal), var(--sky));
  --weak: #c2261c; --fair: #d18b0a; --strong: #0d9488; --paid: #47607a; --mark: #fde68a;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: var(--sans); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--wash); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, p, ol, ul, dl, dd, table { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: var(--mono); }

/* ---- the frame: side menu, top bar, content */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--ink); color: #b9c6d0; padding: 18px 12px 16px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 12px 22px; text-decoration: none; }
.brand i { width: 22px; height: 22px; background: var(--grad); flex: none; }
.brand b { display: block; font-family: var(--serif); font-size: 19px; font-weight: 600; color: #fff; line-height: 1.1; }
.brand small { font-size: 12px; color: #8fa1ae; }
.side nav { display: flex; flex-direction: column; }
.side .group { padding: 18px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #71838f; }
.side nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; font-size: 14.5px; text-decoration: none; }
.side nav a:hover { color: #fff; }
.side nav a.on { background: rgba(255,255,255,.09); color: #fff; font-weight: 600; }
.side nav a.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--teal), var(--sky)); }
.side nav svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; }
.side-foot { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: 12.5px; color: #8fa1ae; line-height: 1.6; }
.side-foot a { color: #fff; text-underline-offset: 3px; }
.main { min-width: 0; }
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; min-height: 52px; padding: 10px 32px; background: #fffbea; border-bottom: 1px solid #f0e2a6; font-size: 13.5px; }
.bar .eg { text-decoration: underline dashed #7c8a95 1px; text-underline-offset: 4px; }
.org { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.org i { display: grid; place-items: center; width: 28px; height: 28px; background: var(--grad); color: #fff; font-style: normal; font-size: 13px; }
.content { max-width: 1240px; padding: 28px 32px 72px; }

/* ---- type */
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
h1 { font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.15; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; }
.meta { font-size: 13px; color: var(--muted); }
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 22px; }
.ph.tight { margin-bottom: 14px; }
.ph .meta { font-size: 14.5px; margin-top: 4px; }
.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { text-underline-offset: 3px; }
.title-line { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.notice { display: inline-block; margin: 0 8px 8px 0; padding: 8px 14px; font-size: 14px; background: #fffbea; border: 1px solid #f0e2a6; }
.error { color: var(--weak); font-weight: 500; font-size: 14px; }

/* ---- numbers that open their PDF page */
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
a.num { text-decoration: underline dashed #9aa7b1 1px; text-underline-offset: 4px; cursor: pointer; border-radius: 2px; }
a.num:hover, a.num.showing { background: var(--mark); box-shadow: 0 0 0 3px var(--mark); text-decoration-color: transparent; color: var(--ink); }
a.num.unconfirmed { text-decoration-color: var(--weak); }

/* ---- buttons, chips, tags */
.btn { display: inline-flex; align-items: center; padding: 10px 18px; font-weight: 600; font-size: 14.5px; text-decoration: none; background: #fff; border: 1px solid var(--line); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip { display: inline-flex; padding: 6px 12px; font-size: 13.5px; border: 1px solid var(--line); background: #fff; text-decoration: none; white-space: nowrap; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tag { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--ink); }
.tag::before { content: ""; width: 9px; height: 9px; background: var(--strong); }
.tag.weak::before { background: var(--weak); } .tag.fair::before { background: var(--fair); }
.more { font-weight: 600; font-size: 13.5px; text-decoration: none; white-space: nowrap; }
.more:hover { text-decoration: underline; text-underline-offset: 4px; }
.quiet { text-decoration: none; }
.quiet:hover { text-decoration: underline; text-underline-offset: 4px; }
.other { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.other::before { content: ""; width: 9px; height: 9px; margin: 0 4px; background: #9aa7b1; }
.okmark { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.okmark::before { content: "✓"; display: grid; place-items: center; flex: none; width: 17px; height: 17px; background: var(--teal); color: #fff; font-size: 11px; }
.push { margin-left: auto; }

/* ---- cards and the key numbers */
.card { display: block; background: #fff; border: 1px solid var(--line); }
.card + .card, .row + .card, .card + .row, .kpis + .card, .tab > .kpis + .card { margin-top: 16px; }
.card.narrow { max-width: 720px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 .meta { margin-left: 10px; font-weight: 400; }
.card-foot { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; padding: 12px 20px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); background: #fbfcfd; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.legend .tag { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.pad { padding: 18px 20px 20px; }
.scroll { overflow-x: auto; }
.row { display: grid; gap: 16px; align-items: start; }
.row .card { margin-top: 0; }
.row.half { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { padding: 18px 20px 20px; background: #fff; border: 1px solid var(--line); }
.kpi-value { font-family: var(--serif); font-weight: 600; font-size: 32px; line-height: 1.15; margin-top: 8px; white-space: nowrap; }
.kpi-value small { font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.kpi-sub { font-size: 13.5px; color: var(--muted); margin-top: 5px; }

/* ---- bars */
.track { position: relative; height: 12px; background: #e4e9ed; }
.track .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 2px 2px 0; background: var(--strong); }
.track.weak .fill { background: var(--weak); } .track.fair .fill { background: var(--fair); } .track.paid .fill { background: var(--paid); }
.track .t70 { position: absolute; left: 70%; top: -4px; bottom: -4px; border-left: 1.5px solid var(--ink); }
.track.slim { height: 7px; }

/* ---- tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 12px 10px; border-bottom: 1px solid var(--ink); white-space: nowrap; vertical-align: bottom; line-height: 1.35; }
.tbl td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fafbfc; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .name { font-weight: 500; }
.tbl.wide { min-width: 720px; }
.tbl.wide td { white-space: nowrap; }
.who a { font-weight: 600; font-size: 15px; text-decoration: none; }
.who a:hover { text-decoration: underline; text-underline-offset: 4px; }
.pctcell { display: grid; grid-template-columns: 96px 40px auto; gap: 10px; align-items: center; }
.pctcell b { font-family: var(--serif); font-size: 17px; text-align: right; }
.part { display: inline-block; font-size: 12.5px; color: var(--muted); background: var(--wash); padding: 2px 8px; white-space: nowrap; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.toolbar input, .toolbar select { height: 40px; padding: 0 12px; font-size: 14px; border: 1px solid var(--line); background: #fff; outline: none; }
.toolbar input { width: 260px; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--ink); }
.toolbar .meta b { color: var(--ink); }

/* ---- what comes due: five years per community */
.mx { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 14px; }
.mx th { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: right; padding: 14px 8px 11px; border-bottom: 1px solid var(--ink); vertical-align: bottom; line-height: 1.35; white-space: nowrap; }
.mx th.l, .mx td.l { text-align: left; }
.mx th:first-child, .mx td:first-child { padding-left: 20px; }
.mx th:last-child, .mx td:last-child { padding-right: 20px; }
.mx td { padding: 4px 3px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mx tr:last-child td { border-bottom: 0; }
.mx td:first-child { padding-top: 10px; padding-bottom: 10px; }
.mx td.total { padding: 0 20px 0 14px; font-weight: 700; }
.cell { display: block; width: 92px; margin-left: auto; padding: 8px 9px; font-weight: 500; }
a.num.cell { border-radius: 0; text-decoration-color: currentColor; }
a.num.cell:hover, a.num.cell.showing { background: var(--mark); box-shadow: none; outline: 2px solid var(--ink); outline-offset: -2px; }
.h0 { color: #b3bdc5; }
.h1 { background: #e9f6f4; } .h2 { background: #c8e9e4; } .h3 { background: #93d4cb; } .h4 { background: #45ada2; color: #fff; } .h5 { background: #0a6e65; color: #fff; }

/* ---- one community */
.tabs { display: flex; gap: 4px; margin: 14px 0 16px; border-bottom: 1px solid var(--line); }
.tabs a { position: relative; padding: 10px 14px; font-size: 14.5px; color: var(--muted); text-decoration: none; }
.tabs a.on { color: var(--ink); font-weight: 600; }
.tabs a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--grad); }
.years { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.year { padding: 16px 18px 10px; border-right: 1px solid var(--line); }
.year:last-child { border-right: 0; }
.year .sum { font-family: var(--serif); font-weight: 600; font-size: 21px; margin-top: 2px; }
.year ul { margin-top: 10px; }
.year li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.35; display: grid; gap: 2px; justify-items: start; }
.year li span { color: var(--muted); }
.checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.check b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 600; }
.check span { font-size: 13.5px; color: var(--muted); }

/* ---- reserve studies: add one */
.drop { display: grid; gap: 6px; align-content: center; justify-items: center; text-align: center; padding: 34px 24px; border: 2px dashed #9aa7b1; background: var(--wash); cursor: pointer; }
.drop:hover, #drop.over .drop { border-color: var(--teal); background: #eef8f7; }
.drop strong { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.drop span { font-size: 13.5px; color: var(--muted); }
.sample { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 14px; color: var(--muted); }
.sample .btn { padding: 7px 14px; font-size: 14px; color: var(--ink); }
.sample + .error { margin-top: 12px; }
.progress li { position: relative; padding: 16px 20px 16px 56px; border-bottom: 1px solid var(--line); color: var(--muted); }
.progress li:last-child { border-bottom: 0; }
.progress li::before { content: ""; position: absolute; left: 20px; top: 19px; width: 18px; height: 18px; border: 2px solid var(--line); border-radius: 50%; }
.progress li.now { color: var(--ink); }
.progress li.now::before { border-color: var(--teal); border-top-color: transparent; animation: spin .9s linear infinite; }
.progress li.done { color: var(--ink); }
.progress li.done::before { content: "✓"; display: grid; place-items: center; border: 0; border-radius: 0; background: var(--teal); color: #fff; font-size: 12px; width: 20px; height: 20px; }
.progress p { font-size: 13.5px; color: var(--muted); }
.clock { font-family: var(--mono); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- behind the demo */
.promise td:first-child { width: 38%; font-family: var(--serif); font-size: 16px; }
.promise td { vertical-align: top; padding-top: 14px; padding-bottom: 14px; }
.pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pipe li { padding: 18px 20px 20px; border-right: 1px solid var(--line); }
.pipe li:last-child { border-right: 0; }
.pipe .n { font-family: var(--serif); font-size: 14px; color: var(--muted); }
.pipe h3 { margin-top: 2px; font-family: var(--serif); font-size: 20px; font-weight: 600; }
.pipe p { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.pipe code { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--muted); }
/* ---- the PDF page, in a panel over the right side */
#proof { position: fixed; top: 0; right: 0; bottom: 0; width: min(46vw, 700px); z-index: 20; display: flex; flex-direction: column; background: #e6ebef; border-left: 1px solid var(--line); box-shadow: -28px 0 56px -28px rgba(20,33,43,.5); }
.proof-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 20px; background: #fff; border-bottom: 1px solid var(--line); }
.proof-title { font-family: var(--serif); font-weight: 600; font-size: 18px; margin-top: 3px; }
.proof-actions { display: flex; align-items: center; gap: 16px; font-size: 14px; white-space: nowrap; }
.proof-actions a { text-underline-offset: 4px; }
#proof-close { width: 38px; height: 38px; border: 0; background: var(--wash); font-size: 22px; line-height: 1; cursor: pointer; }
#proof-scroll { flex: 1; overflow: auto; padding: 20px; }
#proof-sheet { position: relative; width: 128%; background: #fff; box-shadow: 0 2px 14px rgba(20,33,43,.14); }
#proof-sheet img { display: block; width: 100%; }
.hit { position: absolute; background: rgba(250,204,21,.4); outline: 2px solid #eab308; outline-offset: 2px; mix-blend-mode: multiply; }

/* ---- narrower screens */
@media (max-width: 1180px) {
  .kpi-value { font-size: 27px; }
}
@media (max-width: 900px) {
  .app { display: block; }
  .side { position: static; height: auto; padding: 12px 12px 6px; }
  .brand { padding: 2px 8px 10px; }
  .side nav { flex-direction: row; overflow-x: auto; gap: 2px; }
  .side nav a { padding: 8px 10px; white-space: nowrap; font-size: 14px; }
  .side nav a.on::before { top: auto; right: 0; width: auto; height: 3px; background: var(--grad); }
  .side nav svg, .side .group, .side-foot, .org { display: none; }
  .bar { position: static; padding: 10px 16px; }
  .content { padding: 20px 16px 56px; }
  h1 { font-size: 25px; }
  .ph { flex-direction: column; align-items: flex-start; gap: 12px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 23px; }
  .kpi-value small { display: block; margin: 2px 0 0; }
  .card-head { flex-wrap: wrap; gap: 4px 16px; }
  .years, .pipe, .checks { grid-template-columns: minmax(0, 1fr); }
  .year, .pipe li { border-right: 0; border-bottom: 1px solid var(--line); }
  .year:last-child, .pipe li:last-child { border-bottom: 0; }
  .toolbar input, .toolbar select { width: 100%; }
  .toolbar .push { margin-left: 0; }
  #proof { width: 100vw; }
}
@media (max-width: 640px) {
  /* Phones: one answer per row. The year-by-year amounts are on each community's page. */
  .tbl.wide, .mx { min-width: 0; }
  .tbl.wide td:first-child, .mx td:first-child { white-space: normal; }
  .tbl.wide th:nth-child(n+3), .tbl.wide td:nth-child(n+3) { display: none; }
  .pctcell { grid-template-columns: 38px auto; }
  .pctcell .track { display: none; }
  .mx th:nth-child(n+2):nth-child(-n+6), .mx td:nth-child(n+2):nth-child(-n+6) { display: none; }
  .kpis.three { grid-template-columns: minmax(0, 1fr); }
}
