:root {
  color-scheme:light;
  --paper:#F3EFE6;
  --ink:#1E2A33;
  --teal:#0E5C61;
  --sand:#EFE6D2;
  --gold:#B8862B;
  --miss:#D2462E;
  --line:#C9C0AE;
  --muted:#57636A;
  --sans:'IBM Plex Sans',sans-serif;
  --mono:'IBM Plex Mono',monospace;
  --heading:'Fraunces',serif;
}
* {
  box-sizing:border-box;
}
html,body {
  margin:0;
  min-width:360px;
  background:var(--paper);
  color:var(--ink);
  font:14px/1.5 var(--sans);
}
body {
  overflow-x:hidden;
}
button,input,select {
  font:inherit;
  color:inherit;
}
button,a,input,select,summary {
  -webkit-tap-highlight-color:transparent;
}
button {
  min-height:36px;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:6px;
  background:transparent;
  cursor:pointer;
  font-weight:500;
  line-height:1.25;
}
button:hover:not(:disabled) {
  background:#E8E3D7;
  border-color:var(--teal);
}
button:disabled {
  opacity:.4;
  cursor:not-allowed;
}
button:disabled:hover {
  background:transparent;
  border-color:var(--line);
}
button.gold {
  border-color:var(--gold);
  background:#B8862B14;
}
a {
  color:var(--teal);
  text-underline-offset:3px;
}
a:hover {
  text-decoration-thickness:2px;
}
:focus-visible {
  outline:3px solid var(--teal);
  outline-offset:3px;
}
h1,h2,h3,p {
  margin:0;
}
h1,h2,h3 {
  font-family:var(--heading);
  font-weight:600;
  line-height:1.15;
}
h1 {
  font-size:clamp(23px,2.7vw,40px);
  letter-spacing:-.7px;
}
h2 {
  font-size:24px;
  letter-spacing:-.4px;
}
h3 {
  font-size:18px;
}
p+p {
  margin-top:10px;
}
small {
  font-size:12px;
}
.mono,output {
  font-family:var(--mono);
  font-variant-numeric:tabular-nums;
}
.muted {
  color:var(--muted);
  font-size:12px;
}
.eyebrow {
  font:500 10px/1.4 var(--mono);
  letter-spacing:1.2px;
}
.panel {
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--paper);
}
.chip {
  display:inline-block;
  border:1px solid var(--line);
  border-radius:4px;
  padding:2px 6px;
  font:400 10px/1.45 var(--sans);
  vertical-align:middle;
  white-space:normal;
}
.gold-chip {
  border-color:#B8862B70;
  color:#745016;
  background:#B8862B0C;
}
.assumption {
  font-size:9px;
  color:var(--muted);
  padding:1px 4px;
}
.rules {
  color:var(--teal);
  border-color:#0E5C6150;
}
.live-ai {
  color:var(--teal);
  border-color:var(--teal);
}
.error {
  border-color:var(--miss)!important;
}
.section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.section-heading .eyebrow {
  display:block;
  margin-bottom:7px;
}
.section-heading h2 {
  font-size:23px;
}
.section-heading button {
  flex:none;
}
.topbar {
  height:56px;
  display:flex;
  align-items:center;
  gap:24px;
  padding:0 24px;
  border-bottom:1px solid var(--line);
}
.wordmark {
  font:600 26px var(--heading);
  letter-spacing:-1px;
  color:var(--ink);
  text-decoration:none;
  display:flex;
  align-items:baseline;
  gap:4px;
}
.subtitle {
  font-size:12px;
  color:var(--muted);
}
.top-chips {
  margin-left:auto;
  display:flex;
  gap:12px;
}
.topbar>button {
  font-size:12px;
}
.workspace {
  height:calc(100dvh - 56px);
  display:grid;
  grid-template-columns:minmax(0,1fr) 400px;
  min-height:500px;
}
.map-column {
  min-width:0;
  display:flex;
  flex-direction:column;
  border-right:1px solid var(--line);
  overflow:hidden;
  position:relative;
}
.map-stage {
  min-height:250px;
  position:relative;
  flex:1;
  overflow:hidden;
  background:radial-gradient(ellipse at 57% 50%,#E5E3D330,transparent 65%);
}
.map-heading {
  min-width:0;
}
.map-header {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:24px 28px 12px;
}
.map-heading .eyebrow {
  color:var(--teal);
}
.map-heading h1 {
  margin-top:9px;
}
.map-heading p {
  color:var(--muted);
  font-size:12px;
  margin-top:8px;
}
.map-canvas {
  position:absolute;
  inset:0 32px 46px 32px;
  display:flex;
  justify-content:center;
  align-items:center;
}
.map-canvas svg {
  height:100%;
  width:100%;
  overflow:visible;
}
.ward-shapes path {
  stroke:var(--paper);
  stroke-width:1;
  vector-effect:non-scaling-stroke;
  cursor:pointer;
  transition:fill 90ms;
}
.ward-shapes path:hover {
  filter:brightness(1.08);
  stroke:var(--ink);
  stroke-width:1.7;
}
.ward-shapes path:focus-visible {
  outline:none;
  stroke:var(--ink);
  stroke-width:4;
}
.ward-shapes path.miss {
  stroke:var(--miss);
  stroke-width:2.5;
}
.ward-shapes path.plan-miss {
  stroke:var(--miss);
  stroke-width:2.5;
  stroke-dasharray:5 3;
}
.precinct-lines {
  fill:none;
  stroke:var(--ink);
  stroke-width:.4;
  stroke-opacity:.35;
  vector-effect:non-scaling-stroke;
}
.ward-label {
  fill:var(--ink);
  font:500 16px var(--mono);
}
.ward-label text {
  paint-order:stroke;
  stroke:var(--paper);
  stroke-width:2px;
  stroke-opacity:.7;
}
.ward-label.light-label text {
  fill:var(--paper);
  stroke:var(--teal);
  stroke-opacity:.5;
}
.fund-track {
  fill:var(--paper);
  fill-opacity:.8;
}
.fund-bar {
  fill:var(--gold);
}
#selection-outline {
  stroke:var(--ink);
  stroke-width:3.5;
  vector-effect:non-scaling-stroke;
}
.map-tools {
  display:flex;
  align-items:center;
  gap:12px;
  flex-shrink:0;
}
.ward-jump {
  font-size:11px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:6px;
}
.ward-jump select {
  width:80px;
  font-family:var(--mono);
  min-height:36px;
  padding:4px;
}
.legend {
  position:absolute;
  bottom:24px;
  left:28px;
  width:172px;
  font-size:11px;
  background:#F3EFE6ED;
  padding:8px;
  border:1px solid var(--line);
  border-radius:6px;
  pointer-events:none;
}
.legend-ramp {
  display:flex;
  margin-top:6px;
  height:9px;
  border-radius:2px;
  overflow:hidden;
}
.legend-ramp i {
  flex:1;
}
.legend-ends {
  display:flex;
  justify-content:space-between;
  font-size:10px;
  margin:3px 0 6px;
}
.legend small {
  font-size:10px;
  line-height:1.65;
}
.gold-key {
  display:inline-block;
  background:var(--gold);
  width:15px;
  height:3px;
  margin-right:4px;
  vertical-align:middle;
}
.miss-key {
  display:inline-block;
  width:15px;
  height:8px;
  border:2px solid var(--miss);
  margin-right:4px;
}
.miss-key.dashed {
  border-style:dashed;
}
.map-footnote {
  position:absolute;
  bottom:22px;
  right:24px;
  color:var(--muted);
  font:10px var(--mono);
}
.map-tooltip {
  position:absolute;
  max-width:280px;
  background:var(--ink);
  color:var(--paper);
  border-radius:5px;
  padding:9px 12px;
  font-size:12px;
  z-index:5;
  pointer-events:none;
}
.sidebar {
  padding:20px 16px;
  overflow-y:auto;
  min-width:0;
  scrollbar-width:thin;
}
.plan-controls {
  display:grid;
  gap:16px;
}
.budget-panel {
  padding:18px;
}
.budget-panel .section-heading h2 {
  font-size:23px;
}
.budget-panel .section-heading>.chip {
  align-self:flex-start;
  font-size:9px;
}
.budget-label {
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:12px;
  margin:24px 0 12px;
}
.budget-label output {
  font-size:30px;
  letter-spacing:-1px;
  line-height:1;
}
input[type=range] {
  width:100%;
  height:28px;
  margin:0;
  accent-color:var(--teal);
  cursor:ew-resize;
}
.range-labels {
  display:flex;
  justify-content:space-between;
  font-size:10px;
  color:var(--muted);
  margin-bottom:20px;
}
.plan-stats {
  display:grid;
  gap:6px;
  font-size:13px;
}
.plan-stats strong {
  font-size:17px;
  margin-left:4px;
}
.drop-note {
  margin:18px 0;
  padding:12px 0;
  border-block:1px solid var(--line);
}
.drop-note p {
  font-size:12px;
  margin-bottom:8px;
}
.budget-panel>[data-action=ask-why] {
  width:100%;
  color:var(--teal);
  border-color:var(--teal);
}
.agent-box {
  margin-top:18px;
  border-top:1px solid var(--line);
  padding-top:16px;
}
.agent-box p {
  margin-top:8px;
}
.picker-row {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin:14px 0;
}
.picker-row label {
  min-width:0;
  font-size:12px;
}
.picker-row select {
  font-family:var(--mono);
  font-size:11px;
}
input:not([type=range]),select {
  width:100%;
  min-width:0;
  min-height:38px;
  border:1px solid var(--line);
  border-radius:5px;
  padding:8px;
  background:var(--paper);
}
input::placeholder {
  color:var(--muted);
}
label>input,label>select {
  display:block;
  margin-top:5px;
}
.button-stack {
  display:grid;
  gap:12px;
}
#ask-answer:not(:empty) {
  margin-top:16px;
  border-left:2px solid var(--teal);
  padding-left:12px;
  font-size:13px;
}
.mode-toggle {
  display:flex;
  border:1px solid var(--line);
  border-radius:8px;
  padding:4px;
  gap:12px;
}
.mode-toggle button {
  flex:1;
  border-color:transparent;
  font-size:13px;
}
.mode-toggle button[aria-pressed=true] {
  background:var(--ink);
  color:var(--paper);
  border-color:var(--ink);
}
.backtest-panel {
  padding:16px;
  margin-top:12px;
}
.backtest-panel>p {
  margin-top:16px;
}
#scorecard {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
  margin-top:16px;
}
#scorecard strong {
  display:block;
  font-size:25px;
  line-height:1.3;
}
#scorecard span {
  font-size:11px;
  color:var(--muted);
}
.ward-card {
  padding:18px;
  margin-top:16px;
}
.ward-card h2 {
  font-size:32px;
}
.ward-numbers {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  padding:20px 0;
  border-bottom:1px solid var(--line);
}
.ward-numbers strong {
  display:block;
  font-size:26px;
  letter-spacing:-1px;
}
.ward-numbers span {
  font-size:13px;
}
.facts {
  margin:16px 0;
}
.facts>div {
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  margin:9px 0;
}
.facts dt {
  font-size:13px;
}
.facts dd {
  font-size:13px;
  margin:0;
  flex:none;
}
.ward-card>p {
  font-size:13px;
}
.card-section {
  border-top:1px solid var(--line);
  padding-top:20px;
  margin-top:20px;
}
.card-section h3 {
  margin-bottom:10px;
}
.card-section>p {
  margin-bottom:12px;
  font-size:13px;
}
.card-section>button {
  width:100%;
}
.give-buttons {
  display:flex;
  gap:12px;
  margin:12px 0;
}
.give-buttons button {
  flex:1;
  padding-inline:8px;
  white-space:nowrap;
}
.funding-total {
  padding:10px 0;
}
.work-row {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  align-items:end;
  margin:12px 0;
}
.work-row input {
  font-family:var(--mono);
}
#work-form label {
  font-size:13px;
}
#work-form select {
  font-size:13px;
}
.money-panel {
  margin-top:16px;
  padding:18px;
}
.money-panel h2 {
  font-size:24px;
}
.money-panel h3 {
  font-size:17px;
  margin:20px 0 10px;
}
.money-panel .section-heading .eyebrow {
  font-size:13px;
  letter-spacing:.5px;
  white-space:nowrap;
  margin:0;
}
.money-panel .muted {
  margin-top:12px;
}
.money-record {
  border-top:1px solid var(--line);
  padding:12px 0;
  font-size:13px;
  overflow-wrap:anywhere;
}
.record-heading {
  display:flex;
  justify-content:space-between;
  gap:12px;
}
.record-heading strong {
  font-weight:500;
}
.record-heading .mono {
  white-space:nowrap;
}
.record-meta {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  color:var(--muted);
  font-size:13px;
  margin:8px 0;
}
.record-meta time {
  flex:none;
}
.status {
  font-size:13px;
  max-width:65%;
  text-align:right;
}
.money-record>p {
  margin:8px 0;
}
.rule-result {
  font-size:13px;
  color:var(--teal);
}
.id-line {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:13px;
  min-width:0;
}
.id-line>span {
  flex:none;
  color:var(--muted);
}
.copy {
  font-size:13px;
  min-width:0;
  overflow-wrap:anywhere;
  user-select:all;
  border-color:transparent;
  padding:8px 0;
  text-align:right;
}
.copy:hover {
  border-color:transparent;
  background:transparent;
  text-decoration:underline;
}
.note {
  font-size:13px;
}
.button-row {
  display:flex;
  gap:12px;
  margin:8px 0;
  flex-wrap:wrap;
}
.money-record>button {
  margin-block:8px;
}
.money-record details {
  margin-top:10px;
}
.money-record-groups {
  margin-top:20px;
}
.money-record-groups>h3 {
  margin-top:20px;
}
.everyone-records {
  margin-top:14px;
  border-top:1px solid var(--line);
}
.everyone-records>summary {
  padding-block:10px;
  font-size:13px;
}
summary {
  cursor:pointer;
  min-height:28px;
  display:list-item;
  padding-block:5px;
  color:var(--teal);
  font-size:11px;
}
.ward-card summary,
.money-panel summary {
  font-size:13px;
}
.ward-card small,
.money-panel small,
.ward-card .muted,
.money-panel .muted,
.ward-card .chip,
.money-panel .chip,
.ward-card .assumption,
.money-panel .assumption {
  font-size:13px;
}
.receipts {
  padding-left:20px;
  font-size:13px;
}
.receipts li {
  margin:10px 0;
}
.receipts .mono {
  font-size:13px;
}
.payroll-panel {
  border-top:1px solid var(--line);
  padding-top:14px;
  margin-top:14px;
}
.payroll-counts {
  display:flex;
  flex-direction:column;
  gap:4px;
  margin:10px 0;
  font-size:13px;
}
.payroll-batches {
  display:flex;
  flex-direction:column;
  gap:16px;
  margin-top:16px;
}
.payroll-batch {
  border:1px solid var(--line);
  border-radius:8px;
  padding:12px;
  background:var(--paper);
  display:flex;
  flex-direction:column;
  gap:8px;
}
.payroll-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-size:13px;
  font-weight:500;
}
.payroll-header time {
  font-weight:400;
  color:var(--muted);
}
.payroll-items {
  display:flex;
  flex-direction:column;
  border-top:1px solid var(--line);
  margin-top:4px;
}
.payroll-item-row {
  border-bottom:1px solid var(--line);
  padding:8px 0;
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:13px;
}
.payroll-item-row:last-child {
  border-bottom:none;
}
.payroll-item-line1,
.payroll-item-line2 {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.payroll-item-line1 {
  font-weight:500;
}
.payroll-item-status-col {
  display:flex;
  align-items:center;
  gap:8px;
}
.data-panel {
  height:40%;
  min-height:260px;
  flex:none;
  margin:0 16px 16px;
  animation:rise 180ms ease-out;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.data-toolbar {
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 14px 0;
}
.data-toolbar h2 {
  font-size:20px;
  white-space:nowrap;
}
.search-label {
  margin-left:auto;
  width:200px;
}
.search-label input {
  font-size:12px;
  min-height:34px;
}
.data-toolbar button {
  font-size:11px;
  min-height:34px;
  white-space:nowrap;
}
.grid-assumptions {
  font-size:10px;
  color:var(--muted);
  padding:6px 14px;
}
.data-body {
  display:grid;
  grid-template-columns:minmax(0,1fr) 260px;
  gap:12px;
  flex:1;
  min-height:0;
  padding:0 12px 12px;
}
#grid {
  height:100%;
  min-height:150px;
  min-width:0;
}
.grid-number {
  font-family:var(--mono);
  font-variant-numeric:tabular-nums;
  text-align:right;
}
.grid-number-header .ag-header-cell-label {
  justify-content:flex-end;
}
.ag-row-selected {
  border-left:3px solid var(--teal)!important;
}
.miss-dot {
  color:var(--miss);
  font-size:17px;
}
.no-miss {
  color:var(--muted);
}
.chart-wrap {
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:0;
  border-left:1px solid var(--line);
}
.chart-wrap h3 {
  font-size:14px;
  padding:5px 10px;
}
#chart {
  flex:1;
  min-height:160px;
  min-width:0;
}
.mobile-tabs {
  display:none;
}
dialog {
  background:var(--paper);
  color:var(--ink);
  border:1px solid var(--line);
  border-radius:10px;
  padding:28px;
  width:min(800px,calc(100vw - 32px));
  max-height:calc(100dvh - 48px);
  overflow-y:auto;
  font-size:14px;
}
dialog::backdrop {
  background:#1E2A3366;
}
dialog .section-heading {
  align-items:flex-start;
}
dialog h2 {
  font-size:32px;
}
dialog h3 {
  margin:28px 0 12px;
}
dialog p,dialog li {
  line-height:1.6;
}
.method {
  padding-left:22px;
  margin:24px 0;
}
.method li {
  padding-left:6px;
  margin:8px 0;
}
.table-scroll {
  overflow-x:auto;
}
.backtest-picks-scroll {
  overflow-x:auto;
}
.backtest-picks-scroll th,.backtest-picks-scroll td {
  padding:8px 4px;
}
.plan-cell {
  display:block;
  position:relative;
  width:100%;
}
.plan-cell-bar {
  position:absolute;
  left:0;
  bottom:3px;
  height:4px;
  border-radius:2px;
  background:#0E5C61;
}
.plan-cell-label {
  position:relative;
}
table {
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}
th,td {
  border-bottom:1px solid var(--line);
  padding:10px 8px;
  text-align:left;
  vertical-align:top;
}
th {
  font-weight:500;
}
tbody th {
  overflow-wrap:anywhere;
}
td.mono {
  font-size:11px;
}
blockquote {
  margin:16px 0;
  border-left:2px solid var(--line);
  padding-left:16px;
  font-size:12px;
  line-height:1.7;
  color:var(--muted);
}
.sources {
  padding-left:20px;
  font-size:12px;
}
.sources li {
  margin:9px 0;
}
.closing-note {
  padding-top:20px;
  border-top:1px solid var(--line);
  font-weight:500;
}
.toast {
  position:fixed;
  bottom:24px;
  left:50%;
  transform:translateX(-50%);
  z-index:40;
  max-width:min(520px,calc(100vw - 32px));
  padding:14px 20px;
  background:var(--paper);
  border:1px solid var(--line);
  border-left:4px solid var(--teal);
  border-radius:8px;
  font-size:13px;
  box-shadow:0 4px 16px #1E2A3314;
}
.toast.error {
  border-left-color:var(--miss);
}
.loading {
  min-height:100dvh;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:16px;
  padding:32px;
  text-align:center;
}
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
.skip-link {
  position:fixed;
  top:-60px;
  left:16px;
  padding:12px;
  background:var(--paper);
  z-index:50;
}
.skip-link:focus {
  top:8px;
}
[hidden] {
  display:none!important;
}
@keyframes rise {
  from {
    transform:translateY(20px);
    opacity:.6;
  }
  to {
    transform:translateY(0);
    opacity:1;
  }
}
@media(min-width:1500px) {
  .workspace {
    grid-template-columns:minmax(0,1fr) 412px;
  }
  .sidebar {
    padding:24px 16px;
  }
  .map-header {
    padding:32px 36px 12px;
  }
  .map-canvas {
    inset:0 50px 55px;
  }
}
@media(min-width:761px) and (max-width:1100px) {
  .workspace {
    grid-template-columns:minmax(0,1fr) 368px;
  }
  .topbar {
    padding-inline:16px;
    gap:16px;
  }
  .subtitle {
    max-width:210px;
    font-size:10px;
  }
  .top-chips {
    gap:8px;
  }
  .top-chips .chip {
    font-size:9px;
  }
  .map-header {
    padding:22px 20px 12px;
  }
  .map-heading h1 {
    font-size:26px;
  }
  .map-tools {
    flex-direction:column;
    align-items:flex-end;
  }
  .map-footnote {
    display:none;
  }
  .map-canvas {
    inset:0 12px 48px;
  }
  .legend {
    left:16px;
    bottom:16px;
    width:150px;
  }
  .data-body {
    grid-template-columns:minmax(0,1fr);
  }
  .chart-wrap {
    display:none;
  }
  .data-toolbar {
    flex-wrap:wrap;
  }
  .data-toolbar h2 {
    font-size:16px;
  }
  .search-label {
    width:130px;
  }
  .grid-assumptions {
    font-size:9px;
  }
}
@media(max-width:760px) {
  html,body {
    font-size:14px;
  }
  .topbar {
    height:52px;
    padding-inline:16px;
    gap:12px;
    position:relative;
    z-index:3;
  }
  .wordmark {
    font-size:23px;
  }
  .subtitle {
    font-size:8px;
    max-width:112px;
    line-height:1.5;
    margin-left:auto;
  }
  .top-chips {
    display:none;
  }
  .topbar>button {
    font-size:12px;
    min-height:44px;
    padding-inline:8px;
  }
  .workspace {
    height:auto;
    min-height:calc(100dvh - 52px);
    display:flex;
    flex-direction:column;
  }
  .map-column {
    height:60dvh;
    min-height:400px;
    flex:none;
    border-right:0;
    border-bottom:1px solid var(--line);
    overflow:visible;
  }
  .map-stage {
    min-height:0;
    overflow:hidden;
  }
  .map-header {
    padding:16px 16px 12px;
  }
  .map-heading .eyebrow {
    font-size:8px;
    letter-spacing:.8px;
  }
  .map-heading h1 {
    font-size:25px;
    letter-spacing:-.5px;
    margin-top:4px;
  }
  .map-heading p {
    font-size:10px;
    margin-top:5px;
  }
  .map-canvas {
    inset:0 16px 42px;
  }
  .map-tools {
    flex-direction:column;
    align-items:flex-end;
    gap:12px;
  }
  .ward-jump {
    font-size:10px;
    display:block;
    text-align:right;
  }
  .ward-jump select {
    width:74px;
    min-height:44px;
    font-size:12px;
  }
  .map-tools>[data-action=grid-toggle] {
    display:none;
  }
  .map-footnote {
    font-size:7px;
    right:16px;
    bottom:3px;
  }
  .legend {
    left:16px;
    bottom:16px;
    width:137px;
    padding:7px;
    font-size:9px;
  }
  .legend-ramp {
    height:7px;
  }
  .legend small,.legend-ends {
    font-size:8px;
  }
  .ward-label {
    font-size:19px;
  }
  .mobile-tabs {
    display:flex;
    gap:12px;
    padding:12px 16px;
    background:var(--paper);
    border-bottom:1px solid var(--line);
    position:sticky;
    top:0;
    z-index:4;
  }
  .mobile-tabs button {
    flex:1;
    min-width:0;
    border-color:transparent;
    padding:8px 0;
    font-size:13px;
  }
  .mobile-tabs button[aria-pressed=true] {
    border-color:var(--ink);
    background:var(--ink);
    color:var(--paper);
  }
  button,summary,input:not([type=range]),select {
    min-height:44px;
  }
  button {
    padding:8px 12px;
  }
  .sidebar {
    padding:16px;
    overflow:visible;
  }
  .plan-controls {
    gap:16px;
  }
  .budget-panel {
    padding:16px;
  }
  .budget-panel .section-heading h2 {
    font-size:25px;
  }
  .budget-panel .section-heading>.chip {
    font-size:8px;
  }
  .budget-label {
    margin-top:22px;
  }
  .budget-label output {
    font-size:34px;
  }
  input[type=range] {
    height:44px;
  }
  .mode-toggle {
    gap:12px;
  }
  .mode-toggle button {
    font-size:14px;
  }
  .money-panel {
    display:none;
    margin:0;
  }
  .ward-card {
    position:fixed;
    inset:auto 16px 16px;
    max-height:82dvh;
    overflow:auto;
    overscroll-behavior:contain;
    z-index:20;
    margin:0;
    padding:16px;
    border-color:var(--ink);
    box-shadow:0 0 0 100vmax #1E2A3355;
  }
  .ward-open {
    overflow:hidden;
  }
  .ward-card>.section-heading {
    position:sticky;
    top:-16px;
    background:var(--paper);
    margin:-16px -16px 0;
    padding:16px;
    z-index:1;
    border-bottom:1px solid var(--line);
  }
  .ward-numbers {
    padding:18px 0;
  }
  .give-buttons {
    gap:12px;
  }
  .give-buttons button {
    padding-inline:8px;
    font-size:13px;
  }
  .card-section>button {
    font-size:13px;
  }
  .copy {
    min-height:44px;
    font-size:13px;
  }
  .record-meta {
    font-size:13px;
  }
  .data-panel {
    height:auto;
    min-height:600px;
    margin:0;
    border-radius:0;
    border:0;
    animation:none;
  }
  .data-toolbar {
    padding:16px;
    gap:12px;
    flex-wrap:wrap;
  }
  .data-toolbar h2 {
    font-size:23px;
  }
  .search-label {
    width:100%;
    order:2;
  }
  .search-label input {
    font-size:14px;
    min-height:44px;
  }
  .data-toolbar>[data-action=grid-toggle] {
    display:none;
  }
  .grid-assumptions {
    padding:0 16px 12px;
    font-size:11px;
  }
  .data-body {
    display:flex;
    flex-direction:column;
    gap:16px;
    padding:0 16px 16px;
    flex:none;
  }
  #grid {
    height:380px;
    min-height:380px;
    flex:none;
  }
  .chart-wrap {
    border-left:0;
    border-top:1px solid var(--line);
    height:260px;
    flex:none;
    padding-top:12px;
  }
  .chart-wrap h3 {
    font-size:18px;
    padding-left:0;
  }
  #chart {
    min-height:210px;
  }
  .workspace[data-tab=grid] .map-column {
    height:auto;
    min-height:0;
    display:contents;
  }
  .workspace[data-tab=grid] .map-stage,
  .workspace[data-tab=grid] .map-header {
    display:none;
  }
  .workspace[data-tab=grid] .data-panel {
    order:2;
  }
  .workspace[data-tab=grid] .mobile-tabs {
    order:1;
  }
  .workspace[data-tab=grid] .sidebar {
    padding:0;
  }
  .workspace[data-tab=grid] .plan-controls {
    display:none;
  }
  .workspace[data-tab=money] .plan-controls {
    display:none;
  }
  .workspace[data-tab=money] .money-panel {
    display:block;
  }
  .workspace[data-tab=money] .map-column {
    height:40dvh;
    min-height:300px;
  }
  .workspace:not([data-tab=grid]) .data-panel {
    display:none!important;
  }
  .toast {
    bottom:16px;
    width:calc(100vw - 32px);
    font-size:13px;
  }
  dialog {
    padding:16px;
    max-height:calc(100dvh - 32px);
    width:calc(100vw - 32px);
  }
  dialog h2 {
    font-size:27px;
  }
  dialog .section-heading button {
    font-size:12px;
  }
  th,td {
    padding:10px 6px;
    font-size:10px;
  }
  td.mono {
    font-size:10px;
  }
  .table-scroll table {
    table-layout:fixed;
  }
  .table-scroll th:first-child {
    width:32%;
  }
  .table-scroll th:nth-child(2) {
    width:22%;
  }
  td {
    overflow-wrap:anywhere;
  }
  .method {
    font-size:13px;
  }
}
.brand {
  display:flex;
  align-items:center;
  gap:24px;
  min-width:0;
}
.ward-label {
  font-size:10px;
}
.ward-label text {
  stroke-width:2px;
}
@media(min-width:761px) and (max-width:1100px) {
  .data-body {
    display:flex;
    flex-direction:column;
    overflow:auto;
  }
  #grid {
    height:220px;
    min-height:220px;
    flex:none;
  }
  .chart-wrap {
    display:flex;
    height:230px;
    min-height:230px;
    border-left:0;
    border-top:1px solid var(--line);
  }
}
@media(max-width:760px) {
  .brand {
    flex:1;
    flex-direction:column;
    align-items:flex-start;
    gap:1px;
  }
  .wordmark {
    font-size:21px;
    line-height:1.1;
  }
  .subtitle {
    font-size:7px;
    line-height:1.25;
    max-width:none;
    margin:0;
  }
  .top-chips {
    display:flex;
    flex-direction:column;
    gap:3px;
    margin:0;
    flex:none;
  }
  .top-chips .chip {
    font-size:7px;
    padding:1px 4px;
  }
  .ward-label {
    font-size:10px;
  }
}
/* The paper beside the city carries the number and the explored plan. */
.wordmark { align-items:center; gap:7px; }
.wordmark-ward { flex:none; color:var(--ink); }
.workspace { grid-template-columns:minmax(0,1fr) 340px; }
.map-stage { background:none; }
.stage-story {
  position:absolute;
  inset:0 auto 0 0;
  width:43%;
  padding:24px;
  overflow-y:auto;
  scrollbar-width:thin;
}
.map-heading h1 { font-size:clamp(28px,2.5vw,44px); line-height:1.12; }
.start-here { display:grid; grid-template-columns:1fr 1fr 1.4fr; gap:12px; margin:18px 0 24px; }
.start-here button { font-size:11px; padding:8px; min-width:0; }
.map-visual { position:absolute; inset:0 0 0 43%; }
.map-canvas { inset:48px 16px 42px; }
.map-tools { position:absolute; right:24px; top:16px; flex-direction:row; align-items:center; flex-wrap:wrap; justify-content:flex-end; max-width:calc(100% - 32px); }
.map-tools>[data-action=plan-csv] { font-size:11px; padding:8px; }
.map-footnote { right:24px; bottom:8px; font-size:8px; }
.legend { left:16px; bottom:24px; width:260px; font-size:10px; }
.precinct-key { display:grid; grid-template-columns:repeat(5,1fr); gap:3px; margin:6px 0; }
.precinct-key i { display:block; height:9px; border:1px solid #C9C0AE70; }
.precinct-key span { font-size:8px; white-space:nowrap; }
.plan-key { display:inline-block; width:15px; height:8px; background:#0E5C6161; border:2px solid var(--teal); margin-right:4px; }
.precinct-heat { animation:heat-in 450ms ease-out both; }
.precinct-heat path { stroke:var(--paper); stroke-width:.35; vector-effect:non-scaling-stroke; }
.backtest-map .precinct-heat { animation:none; opacity:.3; }
.ward-shapes path { stroke:#1E2A3370; stroke-width:.7; transition:none; }
.ward-shapes path.funded { stroke:var(--teal); stroke-width:2; }
.ward-shapes path.miss,.ward-shapes path.plan-miss { stroke:var(--miss); stroke-width:2.5; }
.budget-panel { padding:0; border:0; border-radius:0; background:transparent; }
.budget-panel .section-heading { display:none; }
.budget-label { margin:16px 0 6px; }
.budget-label output { font-size:28px; }
.range-labels { margin-bottom:12px; }
.plan-stats { font-size:12px; }
#cost-per-vote { display:inline-block; margin-left:5px; color:var(--muted); font-size:11px; }
.drop-note { margin:12px 0; padding:8px 0; }
#plan-line { font-size:12px; margin-bottom:12px; }
#plan-line p { margin-top:6px; }
.mode-toggle { gap:12px; }
.mode-toggle button { font-size:12px; padding:8px; }
.sidebar { padding:16px; }
.sidebar>.money-panel:first-of-type { margin-top:0; }
.ward-card { margin-top:0; }
.ward-numbers { grid-template-columns:1.25fr 1fr; }
.ward-numbers strong { font-size:19px; letter-spacing:-.5px; }
.explore-ward-plan { padding-top:8px; }
.ward-card h4 { font-size:13px; margin:16px 0 8px; }
#ward-facts>summary, .ward-history>summary, .older-payrolls>summary { font-size:13px; }
.budget-nudge { animation:budget-nudge 500ms ease-out; }
@keyframes heat-in { from { opacity:0; } to { opacity:1; } }
@keyframes budget-nudge { 50% { filter:drop-shadow(0 0 4px #0E5C6160); } }
@media(min-width:1500px) {
  .workspace { grid-template-columns:minmax(0,1fr) 384px; }
  .stage-story { width:40%; padding:36px; }
  .map-visual { left:40%; }
}
@media(min-width:761px) and (max-width:1100px) {
  .workspace { grid-template-columns:minmax(0,1fr) 304px; }
  .stage-story { width:45%; padding:16px; }
  .map-visual { left:45%; }
  .map-heading h1 { font-size:26px; }
  .legend { width:220px; }
  .precinct-key span { font-size:7px; }
  .map-tools { right:16px; }
}
@media(max-width:760px) {
  .workspace { display:flex; }
  .map-column { height:auto; min-height:0; }
  .map-stage { display:flex; flex-direction:column; min-height:0; overflow:visible; }
  .stage-story { display:contents; }
  .map-heading { order:0; padding:20px 16px 0; }
  .map-heading h1 { font-size:30px; }
  .start-here { display:flex; flex-wrap:wrap; margin:16px 0; gap:12px; }
  .start-here button { font-size:12px; }
  .map-visual { order:1; position:relative; inset:auto; display:flex; flex-direction:column; height:auto; min-height:0; }
  .map-canvas { position:relative; inset:auto; flex:none; width:100%; height:54dvh; min-height:360px; }
  .map-tools { top:0; right:16px; }
  .map-tools>[data-action=grid-toggle] { display:block; }
  .map-footnote { position:relative; display:block; inset:auto; order:3; margin:0; padding:4px 16px 8px; text-align:right; }
  .legend { position:relative; inset:auto; order:2; width:100%; box-sizing:border-box; margin:0; padding:7px; }
  .plan-controls { order:3; padding:16px; }
  .budget-label output { font-size:34px; }
  .sidebar { padding:0 16px 16px; }
  .ward-numbers strong { font-size:21px; }
  .workspace[data-tab=grid] .map-stage { display:none; }
  .workspace[data-tab=money] .map-column { height:auto; min-height:0; }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation:none!important;
    transition:none!important;
    scroll-behavior:auto!important;
  }
}
.estimate-limit, .backtest-limit {
  font-size: 14px;
  font-weight: normal;
  color: var(--muted);
  margin-top: 8px;
}

.payroll-preview-box h4 { margin: 8px 0 4px; }
.payroll-preview-box ul { margin: 0 0 6px; padding-left: 18px; font-size: 14px; }
.payroll-summary-label { display: block; margin-top: 8px; font-size: 13px; }
details.evidence { margin: 8px 0; font-size: 14px; }
details.evidence summary { cursor: pointer; font-weight: 600; }
details.evidence p { margin: 6px 0; }
.evidence-lines, .evidence-receipts ul { margin: 6px 0; padding-left: 18px; }
.evidence-items { list-style: none; margin: 6px 0; padding: 0; }
.evidence-item { padding: 6px 0; border-bottom: 1px solid var(--line, rgba(128,128,128,.3)); font-size: 13px; overflow-wrap: anywhere; }
.evidence-item div { margin: 2px 0; }
