/* Riding Ledger — palette borrowed from Canadian topographic map sheets. */
/* Self-hosted (SIL OFL, see fonts/OFL.txt). 'optional' means a late font never re-lays out the page. */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: optional;
  src: url("fonts/atkinson-next-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: optional;
  src: url("fonts/atkinson-next-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #F2F4F1;
  --paper-deep: #E4E9E5;
  --ink: #16222A;
  --muted: #56666E;
  --rule: #C9D2CF;
  --water: #1F5FA6;
  --water-deep: #174A82;
  --wood: #2F6B3A;
  --wood-pale: #D3E4CF;
  --warn: #8C4A00;

  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Modular scale, ratio 1.25, base 17px */
  --s-1: 0.85rem;
  --s0: 1rem;
  --s1: 1.25rem;
  --s2: 1.563rem;
  --s3: 1.953rem;
  --s4: 2.441rem;
  --s5: clamp(2.6rem, 8vw, 4.77rem);

  --gap: clamp(1rem, 4vw, 2rem);
  --measure: 68ch;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 106.25%; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: rgba(31, 95, 166, 0.15); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--s0);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  touch-action: manipulation;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: var(--water); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--water-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--water); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.1; text-wrap: balance; margin: 0; }
p { text-wrap: pretty; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

.masthead {
  min-height: 3.6rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.9rem var(--gap);
  border-bottom: 1px solid var(--rule);
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 800; color: var(--ink); text-decoration: none; font-size: var(--s1); letter-spacing: -0.01em; }
.brand svg path { fill: var(--water); }
.brand:hover { color: var(--ink); }
.masthead-link { font-size: var(--s-1); }

main { min-height: 100vh; padding: 0 var(--gap) 4rem; max-width: 76rem; margin: 0 auto; outline: none; }
main section { scroll-margin-top: 1rem; }
.loading, .empty { color: var(--muted); padding: 3rem 0; }
.colophon { border-top: 1px solid var(--rule); padding: 1.5rem var(--gap) 2.5rem; color: var(--muted); font-size: var(--s-1); }
.colophon p { max-width: var(--measure); margin: 0; }

/* ---------- Home ---------- */
.finder { padding: clamp(2rem, 7vw, 4.5rem) 0 1.5rem; max-width: 52rem; }
.finder h1 { font-size: var(--s5); font-weight: 800; letter-spacing: -0.035em; line-height: 0.95; }
.finder .lede { font-size: var(--s1); max-width: 40ch; color: var(--muted); margin: 1rem 0 1.75rem; line-height: 1.4; }

.search { position: relative; }
.search input {
  width: 100%;
  font: inherit; font-size: var(--s2); font-weight: 600;
  padding: 0.7rem 0.2rem 0.55rem;
  color: var(--ink);
  background: transparent;
  border: 0; border-bottom: 3px solid var(--ink);
  border-radius: 0;
}
.search input::placeholder { color: #7D8B91; font-weight: 400; }
.search input:focus-visible { outline: none; border-bottom-color: var(--water); }
.search label { display: block; font-size: var(--s-1); color: var(--muted); margin-bottom: 0.25rem; }

.controls { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; margin: 1.5rem 0 0.5rem; }
.provinces { display: flex; flex-wrap: wrap; gap: 0.35rem; border: 0; padding: 0; margin: 0; }
.provinces legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.chip {
  font: inherit; font-size: var(--s-1); font-weight: 600;
  min-height: 2.25rem; min-width: 2.75rem; padding: 0.3rem 0.6rem;
  color: var(--ink); background: transparent;
  border: 1px solid var(--rule); border-radius: 999px; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.sort { display: flex; align-items: center; gap: 0.5rem; font-size: var(--s-1); color: var(--muted); }
select {
  font: inherit; font-size: var(--s-1); color: var(--ink); background-color: var(--paper);
  border: 1px solid var(--rule); border-radius: 6px; padding: 0.4rem 0.5rem; min-height: 2.25rem;
}
.count { font-size: var(--s-1); color: var(--muted); margin: 0.75rem 0 0; }

.ledger { list-style: none; margin: 0.5rem 0 0; padding: 0; border-top: 2px solid var(--ink); }
.ledger li { border-bottom: 1px solid var(--rule); }
.entry {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  grid-template-areas: "shape name" "shape figs";
  gap: 0.15rem 1rem; align-items: center;
  padding: 0.9rem 0.25rem; text-decoration: none; color: var(--ink);
  transition: background-color 0.15s;
}
.entry:hover { background: var(--paper-deep); color: var(--ink); }
.entry:hover .entry-name { text-decoration: underline; text-underline-offset: 0.15em; }
.entry svg { grid-area: shape; width: 3.5rem; height: 3.5rem; }
.entry-name { grid-area: name; min-width: 0; }
.entry-name strong { display: block; font-size: var(--s1); font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.entry-name span { color: var(--muted); font-size: var(--s-1); }
.figs { grid-area: figs; display: flex; flex-wrap: wrap; gap: 0.2rem 1.25rem; font-size: var(--s-1); color: var(--muted); }
.figs b { color: var(--ink); font-weight: 600; }

.shape-thumb path { fill: var(--ink); }
.party { display: inline-block; width: 0.6em; height: 0.6em; border-radius: 50%; margin-right: 0.35em; vertical-align: 0.05em; background: #6B7A80; }
.party-lib { background: #C8102E; }
.party-con { background: #1A4782; }
.party-ndp { background: #E06A12; }
.party-bq { background: #0E8AA8; }
.party-grn { background: #3D8B35; }

@media (min-width: 52rem) {
  .entry {
    grid-template-columns: 3.5rem minmax(0, 1.4fr) minmax(0, 1fr);
    grid-template-areas: "shape name figs";
  }
  .figs { justify-content: flex-end; text-align: right; }
}

/* ---------- Riding ---------- */
.back { display: inline-block; margin: 1.25rem 0 0; font-size: var(--s-1); }
.riding-head {
  display: grid; gap: 1.5rem; align-items: end;
  padding: 1.5rem 0 2rem; border-bottom: 2px solid var(--ink);
}
/* Phones: name first, outline after it at a modest size. */
.riding-head figure { order: 2; }
.riding-head .shape { width: min(100%, 18rem); }
.riding-head figure { margin: 0; }
.riding-head .shape { width: min(100%, 26rem); aspect-ratio: 1; display: block; }
.shape-big path { fill: #C4DABF; stroke: var(--ink); stroke-width: 1.25; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.shape-big circle { fill: var(--water); fill-opacity: 0.8; stroke: var(--paper); stroke-width: 1; vector-effect: non-scaling-stroke; }
.riding-head figcaption { font-size: var(--s-1); color: var(--muted); margin-top: 0.5rem; max-width: 34ch; }
.riding-head h1 { font-size: var(--s5); font-weight: 800; letter-spacing: -0.035em; line-height: 0.95; overflow-wrap: anywhere; hyphens: auto; }
.riding-head .prov { color: var(--muted); font-size: var(--s1); margin: 0 0 0.6rem; }
.riding-head .fr { color: var(--muted); font-size: var(--s1); margin: 0.6rem 0 0; }
.mp { margin-top: 1.25rem; font-size: var(--s1); }
.mp p { margin: 0.15rem 0; }
.mp .who { font-weight: 800; }
.mp .since { color: var(--muted); font-size: var(--s0); }

@media (min-width: 52rem) {
  .riding-head { grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); gap: 3rem; }
  .riding-head figure { order: 0; }
  .riding-head .shape { width: min(100%, 26rem); }
}

.block { padding: 2.25rem 0; border-bottom: 1px solid var(--rule); }
.block > h2 { font-size: var(--s3); font-weight: 800; letter-spacing: -0.02em; }
.block > .intro { color: var(--muted); max-width: var(--measure); margin: 0.6rem 0 1.5rem; }
.block h3 { font-size: var(--s1); font-weight: 800; margin: 2rem 0 0.75rem; }

.money-row { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; align-items: baseline; }
.figure-big { font-size: var(--s4); font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.figure-note { color: var(--muted); font-size: var(--s-1); margin-top: 0.35rem; max-width: 30ch; }

.bar { display: block; width: 100%; max-width: 44rem; height: 0.9rem; margin: 1.25rem 0 0.75rem; border-radius: 2px; }
.bar rect { stroke: var(--paper); stroke-width: 0.4; vector-effect: non-scaling-stroke; }
.bar .bar-bg { fill: var(--paper-deep); stroke: none; }
.seg-base { fill: var(--ink); background: var(--ink); }
.seg-elector { fill: var(--water); background: var(--water); }
.seg-geographic { fill: var(--wood); background: var(--wood); }
.seg-schedule3 { fill: var(--warn); background: var(--warn); }
.seg-used { fill: var(--ink); }
.key { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; max-width: 44rem; font-size: var(--s-1); }
.key li { display: flex; justify-content: space-between; gap: 1rem; }
.key i.swatch { display: inline-block; width: 0.75rem; height: 0.75rem; margin-right: 0.5rem; vertical-align: -0.05em; border-radius: 2px; }
.key li > span:last-child { font-weight: 600; }

.used { max-width: 44rem; margin-top: 2rem; }
.used p { margin: 0; }
.used .bar { height: 0.5rem; margin: 0.6rem 0 0; }
.figure-note.wide { max-width: var(--measure); }
.updated { color: var(--muted); font-size: var(--s-1); margin: 1.25rem 0 0; }
th[scope="row"] { font-weight: 400; }
.search-projects { flex: 1 1 14rem; display: flex; }

.table-wrap { overflow-x: auto; margin: 0 calc(-1 * var(--gap)); padding: 0 var(--gap); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; min-width: 36rem; font-size: var(--s-1); }
caption { text-align: left; color: var(--muted); padding-bottom: 0.5rem; }
th, td { padding: 0.55rem 0.75rem 0.55rem 0; text-align: right; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--ink); }
tfoot td, tfoot th { font-weight: 800; border-bottom: 0; }
tr.fy-break > * { border-top: 2px solid var(--ink); }

/* Projects */
.tally { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem 2rem; margin: 0 0 1.75rem; max-width: 52rem; }
.tally div { border-left: 4px solid var(--rule); padding-left: 0.75rem; }
.tally .t-done { border-color: var(--wood); }
.tally .t-underway { border-color: var(--water); }
.tally dt { font-size: var(--s-1); color: var(--muted); }
.tally dd { margin: 0; font-size: var(--s2); font-weight: 800; }

.filters { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; margin-bottom: 1rem; }
.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-size: var(--s-1); font-weight: 600; padding: 0.45rem 0.8rem; min-height: 2.5rem; background: transparent; color: var(--ink); border: 0; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.seg button + button { border-left: 1px solid var(--ink); }
.seg button:hover { background: var(--paper-deep); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.check { display: inline-flex; align-items: center; gap: 0.5rem; font-size: var(--s-1); cursor: pointer; min-height: 2.5rem; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--water); margin: 0; }
.filters input[type="search"] { font: inherit; font-size: var(--s-1); padding: 0.45rem 0.6rem; min-height: 2.5rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); flex: 1 1 14rem; max-width: 22rem; }

.projects { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--ink); }
.projects li { border-bottom: 1px solid var(--rule); padding: 1rem 0; display: grid; gap: 0.35rem 1.5rem; grid-template-columns: minmax(0, 1fr); }
.p-title:focus { outline: none; }
.p-title:focus-visible { outline: 3px solid var(--water); }
.p-title { font-weight: 600; font-size: var(--s0); overflow-wrap: anywhere; max-width: var(--measure); }
.p-meta { color: var(--muted); font-size: var(--s-1); max-width: var(--measure); }
.p-money { font-weight: 800; font-size: var(--s1); }
.p-money small { display: block; font-weight: 400; color: var(--muted); font-size: var(--s-1); }
.status { display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--s-1); font-weight: 600; }
.status::before { content: ""; width: 0.65rem; height: 0.65rem; border-radius: 50%; border: 2px solid currentColor; }
.status.done { color: var(--wood); }
.status.done::before { background: currentColor; }
.status.underway { color: var(--water); }
.status.underway::before { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.status.planned { color: var(--muted); }
.shared-note { font-size: var(--s-1); color: var(--warn); }
@media (min-width: 46rem) {
  .projects li { grid-template-columns: minmax(0, 1fr) 11rem; }
  .p-side { text-align: right; grid-row: 1 / span 3; grid-column: 2; }
}
.more { margin-top: 1.25rem; font: inherit; font-weight: 600; padding: 0.65rem 1.1rem; min-height: 2.75rem; background: var(--ink); color: var(--paper); border: 0; border-radius: 8px; cursor: pointer; transition: background-color 0.15s; }
.more:hover { background: var(--water-deep); }

.prose { max-width: var(--measure); }
.prose h1 { font-size: var(--s4); font-weight: 800; letter-spacing: -0.02em; margin: 2rem 0 1rem; }
.prose h2 { font-size: var(--s2); font-weight: 800; margin: 2rem 0 0.5rem; }
.prose li { margin-bottom: 0.4rem; }
.caveat { border-left: 4px solid var(--warn); padding: 0.25rem 0 0.25rem 1rem; max-width: var(--measure); color: var(--ink); }

/* The outline arrives by the view-transition morph; only the project dots fade in after it lands. */
@media (prefers-reduced-motion: no-preference) {
  .riding-head .shape circle { animation: dot-in 260ms var(--ease-out) both; animation-delay: 380ms; }
  @keyframes dot-in { from { opacity: 0; } }
}
@media (pointer: fine) { html { overscroll-behavior: none; } }

/* ---------- Community ---------- */
.masthead-right { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: flex-end; }
.account { display: inline-flex; align-items: center; gap: 0.75rem; }
.account:empty { display: none; }

.btn, .btn-small, .btn-danger {
  font: inherit; font-weight: 600; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--ink); color: var(--paper); transition: background-color 0.15s;
}
.btn { padding: 0.6rem 1.1rem; min-height: 2.75rem; }
.btn-small { font-size: var(--s-1); padding: 0.4rem 0.8rem; min-height: 2.25rem; }
.btn:hover, .btn-small:hover { background: var(--water-deep); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-danger { padding: 0.5rem 1rem; min-height: 2.5rem; background: #9B1C1C; }
.btn-danger:hover { background: #7A1414; }
.btn-quiet, .linklike {
  font: inherit; font-size: var(--s-1); font-weight: 600; color: var(--water); background: none; border: 0;
  padding: 0.35rem 0.1rem; min-height: 2.25rem; cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px;
}
.btn-quiet:hover, .linklike:hover { color: var(--water-deep); text-decoration-thickness: 2px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; align-items: center; margin-top: 0.5rem !important; }
.head-actions { margin: 0.75rem 0 0; }

/* Project rows get an "Ask about this project" link only when the community service is on. */
.ask-project { display: none; margin-top: 0.35rem; }
.community-on .ask-project { display: inline-block; }

.community > .seg { margin: 1.5rem 0 0.5rem; }
.composer { max-width: 44rem; }
.composer-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin: 0; padding: 1rem 1.1rem; background: var(--paper-deep); border-radius: 10px; }
.composer-form { padding: 1.1rem; background: var(--paper-deep); border-radius: 10px; }

.cx-form { display: grid; gap: 0.35rem; }
.cx-form label:not(.check) { font-weight: 600; font-size: var(--s-1); margin-top: 0.6rem; }
.cx-form input:not([type="radio"]):not([type="checkbox"]), .cx-form textarea, .cx-form select {
  font: inherit; color: var(--ink); background: #FFFFFF; border: 1px solid #9AA8AD; border-radius: 6px;
  padding: 0.55rem 0.65rem; min-height: 2.6rem; width: 100%;
}
.cx-form textarea { resize: vertical; line-height: 1.45; }
.cx-form input:focus-visible, .cx-form textarea:focus-visible, .cx-form select:focus-visible { outline: 3px solid var(--water); outline-offset: 1px; }
.cx-form fieldset { border: 0; padding: 0; margin: 0.25rem 0 0; display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.cx-form legend { font-weight: 600; font-size: var(--s-1); padding: 0; margin-bottom: 0.15rem; }
.cx-form .btn, .cx-form .btn-small, .cx-form .btn-danger { justify-self: start; margin-top: 0.75rem; }
.row2 { display: grid; gap: 0 1rem; grid-template-columns: minmax(0, 1fr); }
.row2 > span { display: grid; gap: 0.35rem; }
@media (min-width: 40rem) { .row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hint { color: var(--muted); font-size: var(--s-1); margin: 0.25rem 0 0; }
.form-error { color: #9B1C1C; font-weight: 600; font-size: var(--s-1); margin: 0.25rem 0 0; }
.project-chip { font-size: var(--s-1); margin: 0.5rem 0 0; padding: 0.4rem 0.6rem; border-left: 3px solid var(--water); background: rgba(31, 95, 166, 0.07); }

.feed { display: grid; gap: 0; border-top: 2px solid var(--ink); max-width: 52rem; }
.post { padding: 1.25rem 0 1.1rem 1rem; border-bottom: 1px solid var(--rule); border-left: 4px solid transparent; scroll-margin-top: 1rem; }
.post-update, .post-event { border-left-color: var(--water); }
.post.linked { background: rgba(31, 95, 166, 0.06); }
.post h3 { font-size: var(--s1); font-weight: 800; margin: 0.3rem 0 0.2rem; overflow-wrap: anywhere; }
.post h3:focus { outline: none; }
.post h3:focus-visible { outline: 3px solid var(--water); }
.post-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; }
.tag { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 0.05rem 0.5rem; border-radius: 999px; border: 1px solid var(--ink); color: var(--ink); }
.tag-update { border-color: var(--water); color: var(--water); }
.tag-event { border-color: var(--wood); color: var(--wood); }
.tag-held { border-color: var(--warn); color: var(--warn); }
.verified { display: inline-block; font-weight: 600; color: var(--water-deep); background: rgba(31, 95, 166, 0.1); padding: 0 0.4rem; border-radius: 4px; margin-right: 0.25rem; }
.post-meta { color: var(--muted); font-size: var(--s-1); margin: 0.15rem 0 0; }
.event-when { margin: 0.6rem 0 0; padding: 0.5rem 0.7rem; border-left: 3px solid var(--wood); background: rgba(47, 107, 58, 0.08); max-width: 40rem; }
.post-body { white-space: pre-line; overflow-wrap: anywhere; max-width: var(--measure); margin-top: 0.6rem; }
.post-actions { display: flex; flex-wrap: wrap; gap: 0 1.1rem; margin-top: 0.5rem; position: relative; }
.comments { margin: 0.5rem 0 0; padding: 0.25rem 0 0 1rem; border-left: 2px solid var(--rule); max-width: 44rem; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment { padding: 0.6rem 0; border-bottom: 1px solid var(--rule); }
.comment .post-body { margin-top: 0.25rem; }
.comment-form { margin-top: 0.5rem; }

.cx-dialog { border: 0; border-radius: 12px; padding: 0; width: min(36rem, calc(100vw - 1.5rem)); max-height: calc(100dvh - 2rem); color: var(--ink); background: var(--paper); box-shadow: 0 1.5rem 4rem rgba(22, 34, 42, 0.35); overscroll-behavior: contain; }
.cx-dialog::backdrop { background: rgba(22, 34, 42, 0.55); }
.cx-dialog-inner { padding: 1.25rem 1.25rem 1.5rem; }
.cx-dialog-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.cx-dialog h2 { font-size: var(--s2); font-weight: 800; }
.cx-dialog h3 { font-size: var(--s0); font-weight: 800; margin: 1.5rem 0 0.25rem; }
.cx-toast { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); transform: translate(-50%, 1rem); opacity: 0; pointer-events: none; margin: 0; padding: 0.7rem 1rem; max-width: min(32rem, calc(100vw - 2rem)); background: var(--ink); color: var(--paper); border-radius: 8px; font-weight: 600; transition: opacity 0.2s, transform 0.2s; z-index: 20; }
.cx-toast.show { opacity: 1; transform: translate(-50%, 0); }

.share-menu { position: absolute; z-index: 15; margin-top: 0.35rem; padding: 0.75rem; background: #FFFFFF; border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 0.75rem 2rem rgba(22, 34, 42, 0.18); min-width: 13rem; }
.share-menu ul { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.15rem; }
.share-menu a { display: block; padding: 0.35rem 0.2rem; }
.share-status { display: block; font-size: var(--s-1); color: var(--muted); overflow-wrap: anywhere; }
.head-actions, .post-actions { position: relative; }

.latest { margin: 0.5rem 0 1.5rem; max-width: 52rem; }
.latest h2 { font-size: var(--s1); font-weight: 800; }
.latest-list { list-style: none; padding: 0; margin: 0.5rem 0 0; border-top: 1px solid var(--rule); }
.latest-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--rule); display: grid; gap: 0.1rem; }
.latest-list a { font-weight: 600; }

.sponsor-slot { margin: 1.25rem 0; padding: 0.75rem 1rem; border: 1px dashed #9AA8AD; border-radius: 8px; max-width: 44rem; }
.sponsor-label { margin: 0 0 0.2rem; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.sponsor-link { color: var(--ink); text-decoration: none; }
.sponsor-link:hover { color: var(--ink); text-decoration: underline; }

.admin { padding: 1.5rem 0; }
.admin h1 { font-size: var(--s4); font-weight: 800; margin-bottom: 1rem; }
.admin-body { margin-top: 1.25rem; max-width: 52rem; }
.admin-list { list-style: none; padding: 0; margin: 1rem 0 0; border-top: 2px solid var(--ink); }
.admin-list li { padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.admin-list h3 { font-size: var(--s1); font-weight: 800; margin: 0.3rem 0; }
.admin-form { margin: 0.5rem 0 1.5rem; padding: 1rem; background: var(--paper-deep); border-radius: 10px; }
.term-list { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; list-style: none; padding: 0; }
@media (prefers-reduced-motion: reduce) { .cx-toast { transition: none; } }
/* Narrow screens: segmented controls wrap as separate pills instead of clipping. */
@media (max-width: 34rem) {
  .seg { border: 0; border-radius: 0; overflow: visible; display: flex; flex-wrap: wrap; gap: 0.4rem; }
  .seg button { border: 1px solid var(--ink); border-radius: 999px; }
  .seg button + button { border-left: 1px solid var(--ink); }
}

/* Home with community: latest MP posts sit beside the finder on wide screens; reserved on phones. */
.latest { min-height: 21rem; }
.latest .sponsor-slot { margin-top: 1rem; }
.composer { min-height: 4.5rem; }
@media (min-width: 64rem) {
  .home-top { display: grid; grid-template-columns: minmax(0, 52rem) minmax(16rem, 1fr); gap: 3rem; align-items: start; }
  .home-top .latest { margin-top: clamp(2rem, 7vw, 4.5rem); min-height: 0; }
  .home-top .finder { max-width: none; }
  .home-top .finder h1 { font-size: clamp(2.6rem, 5.4vw, 4.77rem); }
}

/* ---------- Postal code finder ---------- */
.postal { margin-top: 1.25rem; max-width: 30rem; }
.postal label { display: block; font-size: var(--s-1); color: var(--muted); margin-bottom: 0.3rem; }
.postal-row { display: flex; gap: 0.5rem; }
.postal input { font: inherit; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; flex: 0 1 9rem; min-width: 0; padding: 0.4rem 0.6rem; min-height: 2.5rem; border: 1px solid #9AA8AD; border-radius: 6px; background: #FFFFFF; color: var(--ink); }
.postal input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; }
.postal .btn-small { min-height: 2.5rem; }
.postal-msg { font-size: var(--s-1); margin: 0.4rem 0 0; min-height: 1.5em; }

/* ---------- Engagement ---------- */
.response-rate { font-size: var(--s-1); margin: 1rem 0 0; min-height: 1.5em; max-width: 34rem; }
.follow-btn[aria-pressed="true"], .metoo[aria-pressed="true"] { color: var(--wood); text-decoration-style: solid; }
.follow-btn[aria-pressed="true"]::before, .metoo[aria-pressed="true"]::before { content: "✓ "; }
.project-actions { display: inline-flex; flex-wrap: wrap; gap: 0 0.9rem; }
.project-actions .follow-project { display: none; }
.community-on .project-actions .follow-project { display: inline-block; }
.feed-controls { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; margin: 1.5rem 0 0.5rem; }
.tag-answered { border-color: var(--wood); color: #FFFFFF; background: var(--wood); }
.tag-waiting { border-color: var(--muted); color: var(--muted); }
.post.is-answered { border-left-color: var(--wood); }
.comment.is-answer { background: rgba(47, 107, 58, 0.08); border-left: 3px solid var(--wood); padding-left: 0.75rem; }
.answer-label { margin: 0; font-size: 0.78rem; font-weight: 800; color: var(--wood); }
.follow-list { padding-left: 1.1rem; margin: 0.5rem 0 0; }
.follow-list li { margin-bottom: 0.3rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.lang-switch { font-weight: 600; }
.brand { white-space: nowrap; }
@media (max-width: 30rem) {
  .masthead { gap: 0.5rem; }
  .masthead-right { gap: 0.6rem; }
  .masthead-right .masthead-link:not(.lang-switch) { display: none; } /* also in the footer */
}

/* ---------- Project search results (home) ---------- */
.proj-results { margin: 1rem 0 0; max-width: 60rem; }
.proj-results > h2, .ridings-h { font-size: var(--s1); font-weight: 800; margin: 1.25rem 0 0.25rem; }
.proj-hits { list-style: none; padding: 0; margin: 0.5rem 0 0; border-top: 2px solid var(--ink); }
.proj-hits li { border-bottom: 1px solid var(--rule); }
.proj-hit { display: grid; gap: 0.15rem 1.25rem; grid-template-columns: minmax(0, 1fr); padding: 0.75rem 0.25rem; color: var(--ink); text-decoration: none; transition: background-color 0.15s; }
.proj-hit:hover { background: var(--paper-deep); color: var(--ink); }
.proj-hit:hover .proj-hit-title { text-decoration: underline; }
.proj-hit-title { font-weight: 600; overflow-wrap: anywhere; }
.proj-hit-side { display: flex; gap: 0.75rem; align-items: center; font-size: var(--s-1); }
@media (min-width: 46rem) {
  .proj-hit { grid-template-columns: minmax(0, 1fr) 14rem; }
  .proj-hit-side { grid-column: 2; grid-row: 1 / span 2; justify-content: flex-end; }
}

/* ---------- US site ---------- */
.brand-tag { font-size: 0.7em; font-weight: 800; color: var(--paper); background: var(--water); padding: 0.05rem 0.4rem; border-radius: 4px; margin-left: 0.15rem; }
.party-us-dem { background: #1F5FA6; }
.party-us-rep { background: #C8102E; }
.party-us-ind { background: #6B7A80; }
.lang-note { margin: 1.5rem 0 0; font-size: var(--s-1); }
.leg-list { list-style: none; padding: 0; margin: 0.25rem 0 1rem; border-top: 1px solid var(--rule); columns: 1; }
.leg-list li { display: grid; gap: 0.1rem 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); grid-template-columns: minmax(0, 1fr); }
.leg-contact { font-size: var(--s-1); display: flex; flex-wrap: wrap; gap: 0 0.9rem; }
@media (min-width: 52rem) { .leg-list li { grid-template-columns: minmax(0, 1.3fr) 10rem minmax(0, 1fr); align-items: baseline; } }
.zip-result { margin: 1rem 0 0; padding: 1rem 1.1rem; background: var(--paper-deep); border-radius: 10px; max-width: 44rem; }
.zip-h { font-size: var(--s1); font-weight: 800; margin: 0 0 0.5rem; }
.zip-h:focus { outline: none; }
.zip-panel { margin: 0; display: grid; gap: 0.75rem; }
.zip-panel dt { font-size: var(--s-1); color: var(--muted); font-weight: 600; }
.zip-panel dd { margin: 0.1rem 0 0; }

/* =====================================================================
   Modernization pass: hero, motion, feedback, browser surfaces.
   Motion rules: feedback 100–160 ms, state 150–250 ms, overlays 200–400 ms,
   exits faster than entrances, strong ease-out, nothing moves under the pointer.
   ===================================================================== */
:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

/* Browser surfaces carry the palette too. */
::selection { background: rgba(31, 95, 166, 0.22); color: var(--ink); }
html { scrollbar-color: #9AA8AD var(--paper); accent-color: var(--water); }
input, textarea { caret-color: var(--water); }
html:has(.page-nav) { scroll-padding-top: 4rem; }

/* ---------- Hero (home) ---------- */
.hero { display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; padding: clamp(1.75rem, 6vw, 4rem) 0 1.25rem; }
.hero-copy { min-width: 0; }
.hero h1 { font-size: var(--s5); font-weight: 800; letter-spacing: -0.035em; line-height: 0.95; max-width: 14ch; }
.hero .lede { font-size: var(--s1); max-width: 40ch; color: var(--muted); margin: 1rem 0 1.75rem; line-height: 1.4; }
.hero .search { max-width: 40rem; }
.kbd-hint { display: none; font: 600 0.75rem/1 var(--font); color: var(--muted); border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 4px; padding: 0.1rem 0.35rem; margin-left: 0.35rem; vertical-align: 0.1em; }
@media (hover: hover) and (pointer: fine) { .kbd-hint { display: inline-block; } }

.hero-preview { min-width: 0; min-height: 9.5rem; }
.hero-card {
  display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.25rem 1rem; align-items: center;
  padding: 1rem; border-radius: 14px; background: var(--paper-deep); color: var(--ink); text-decoration: none;
  border: 1px solid transparent; transition: border-color 160ms ease, background-color 160ms ease;
}
.hero-shape { width: 6.5rem; height: 6.5rem; grid-row: span 4; }
.hero-shape path { fill: #C4DABF; stroke: var(--ink); stroke-width: 1.25; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: fill 200ms ease; }
.hero-text { display: grid; gap: 0.2rem; min-width: 0; }
.hero-name { font-size: var(--s2); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; overflow-wrap: anywhere; }
.hero-mp, .hero-facts { color: var(--muted); font-size: var(--s-1); }
.hero-open { font-size: var(--s-1); font-weight: 600; color: var(--water); margin-top: 0.35rem; text-decoration: underline; text-underline-offset: 0.18em; }
.hero-caption { font-size: var(--s-1); color: var(--muted); margin: 0.6rem 0 0 0.25rem; }
.hero-empty { padding: 1rem; border-radius: 14px; background: var(--paper-deep); color: var(--muted); margin: 0; }
@media (hover: hover) and (pointer: fine) {
  .hero-card:hover { border-color: var(--water); }
  .hero-card:hover .hero-shape path { fill: #B3D0AC; }
}
.hero-card:active { background: #DCE3DE; }
@media (min-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 1fr); }
  .hero-preview { min-height: 22rem; display: grid; align-content: center; }
  .hero-card { grid-template-columns: 1fr; padding: 1.5rem; }
  .hero-shape { width: 100%; height: auto; aspect-ratio: 1; max-height: 15rem; grid-row: auto; }
  .hero-name { font-size: var(--s3); }
}

.toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; padding: 0.75rem 0; border-top: 1px solid var(--rule); }
.latest-strip { min-height: 0; margin: 1rem 0 0; max-width: none; }
.latest-strip .latest-list { display: grid; gap: 0 2rem; }
@media (min-width: 52rem) { .latest-strip .latest-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.latest-strip .latest-list li:only-child { grid-column: 1 / -1; }

/* ---------- On-this-page bar (riding and member pages) ---------- */
.page-nav { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--rule); margin: 0 calc(-1 * var(--gap)); padding: 0 var(--gap); }
.page-nav ul { display: flex; gap: 0.25rem 1.25rem; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.page-nav a { display: inline-block; padding: 0.75rem 0 0.6rem; font-size: var(--s-1); font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; transition: color 150ms ease, border-color 200ms var(--ease-out); }
.page-nav a:hover { color: var(--ink); }
.page-nav a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--water); }

/* ---------- Press feedback: the interface heard you ---------- */
.btn, .btn-small, .btn-danger, .chip, .seg button, .more, .postal .btn-small { transition: transform 140ms var(--ease-out), background-color 150ms ease, color 150ms ease, border-color 150ms ease; }
.btn:active, .btn-small:active, .btn-danger:active, .chip:active, .seg button:active, .more:active { transform: scale(0.97); }
.btn-quiet:active, .linklike:active { opacity: 0.7; }
.entry:active, .proj-hit:active { background: #DCE3DE; }
@media (hover: none) { .entry:hover, .proj-hit:hover { background: transparent; } }
/* Row hover: the row stays still, its outline takes the colour. */
.shape-thumb path { transition: fill 160ms ease; }
@media (hover: hover) and (pointer: fine) { .entry:hover .shape-thumb path { fill: var(--water); } }

/* ---------- Overlays ---------- */
/* Dialogs: fade and settle in; close faster. Bottom sheet on phones. */
.cx-dialog { opacity: 1; transform: none; transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out), overlay 220ms allow-discrete, display 220ms allow-discrete; }
.cx-dialog:not([open]) { opacity: 0; transform: scale(0.97); transition-duration: 150ms; }
@starting-style { .cx-dialog[open] { opacity: 0; transform: translateY(8px) scale(0.98); } }
.cx-dialog::backdrop { transition: background-color 220ms ease, overlay 220ms allow-discrete, display 220ms allow-discrete; }
@starting-style { .cx-dialog[open]::backdrop { background-color: rgba(22, 34, 42, 0); } }
@media (max-width: 34rem) {
  .cx-dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: calc(100dvh - 3rem); padding-bottom: env(safe-area-inset-bottom); transition-duration: 380ms; transition-timing-function: var(--ease-drawer); }
  .cx-dialog:not([open]) { transform: translateY(100%); transition-duration: 220ms; }
  @starting-style { .cx-dialog[open] { opacity: 1; transform: translateY(100%); } }
  .cx-dialog-inner::before { content: ""; display: block; width: 2.5rem; height: 4px; border-radius: 2px; background: var(--rule); margin: -0.4rem auto 0.9rem; }
}
/* Toast: rises from the edge it lives on (Sonner timing), leaves quicker. */
.cx-toast { transform: translate(-50%, calc(100% + 1.5rem)); transition: opacity 200ms ease, transform 200ms var(--ease-out); }
.cx-toast.show { transform: translate(-50%, 0); transition: opacity 400ms ease, transform 400ms ease; }
/* Share menu grows from its button. */
.share-menu { transform-origin: top left; transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out); }
@starting-style { .share-menu { opacity: 0; transform: scale(0.96) translateY(-4px); } }
/* Comments and the ZIP result appear where they were asked for. */
.comments:not([hidden]), .zip-result, .proj-results:not([hidden]) { transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
@starting-style { .comments:not([hidden]), .zip-result, .proj-results:not([hidden]) { opacity: 0; transform: translateY(-4px); } }

/* ---------- Continuity: the outline you clicked becomes the page's outline ---------- */
.vt-shape, .riding-head .shape { view-transition-name: riding-shape; }
@view-transition { navigation: auto; } /* US pages: same morph across full page loads */
::view-transition-group(riding-shape) { animation-duration: 380ms; animation-timing-function: var(--ease-in-out); }
/* The old page leaves quickly with a slight blur (masks the crossfade); the new page arrives just after. */
::view-transition-old(root) { animation: vt-leave 140ms var(--ease-out) both; }
::view-transition-new(root) { animation: vt-arrive 240ms var(--ease-out) 60ms both; }
@keyframes vt-leave { to { opacity: 0; filter: blur(3px); } }
@keyframes vt-arrive { from { opacity: 0; } }

/* ---------- Reduced motion: fewer, gentler; feedback stays legible ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn:active, .btn-small:active, .btn-danger:active, .chip:active, .seg button:active, .more:active { transform: none; opacity: 0.8; }
  .cx-dialog, .cx-dialog:not([open]), .cx-toast, .cx-toast.show, .share-menu { transform: none !important; transition-property: opacity; }
  .cx-toast { transform: translate(-50%, 0) !important; opacity: 0; }
  .cx-toast.show { opacity: 1; }
  @starting-style { .cx-dialog[open], .share-menu, .comments:not([hidden]), .zip-result, .proj-results:not([hidden]) { transform: none; } }
  .vt-shape, .riding-head .shape { view-transition-name: none; }
  @view-transition { navigation: none; }
}

/* =====================================================================
   Touch and iOS. Native controls stay native (select pickers, date pickers,
   share sheet); they're just sized for fingers. Desktop stays compact.
   ===================================================================== */
main { min-height: 100dvh; }
.page-nav { top: env(safe-area-inset-top); }
button, a, label, select, summary { -webkit-tap-highlight-color: transparent; } /* our own pressed states replace the grey flash */
@media (hover: hover) and (pointer: fine) { .chip:hover { border-color: var(--ink); } }
@media (hover: none) { .chip:hover { border-color: var(--rule); } .chip[aria-pressed="true"]:hover { border-color: var(--ink); } }

@media (pointer: coarse) {
  /* iOS zooms into any field under 16px; keep every field at 16px or more. */
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: max(16px, 1em); }
  .filters input[type="search"], .postal input, select { min-height: 44px; }
  select { padding-block: 0.5rem; }
  /* Apple's minimum tap target: 44 × 44 points. */
  .btn, .btn-small, .btn-danger, .more, .chip, .seg button, .masthead-link, .page-nav a, .btn-quiet, .linklike, .postal .btn-small {
    min-height: 44px; min-width: 44px;
  }
  .masthead-link, .btn-quiet, .linklike { display: inline-flex; align-items: center; justify-content: center; }
  .btn-quiet, .linklike { padding-inline: 0.35rem; }
  .page-nav a { display: inline-flex; align-items: center; justify-content: center; padding-inline: 0.5rem; }
  label.check { min-height: 44px; }
  .check input { width: 1.35rem; height: 1.35rem; }
  .post-actions, .head-actions, .project-actions, .leg-contact { gap: 0.25rem 0.75rem; }
}
/* Dropdowns: our own frame and chevron, so iOS honours the size; tapping still opens the native picker. */
select {
  -webkit-appearance: none; appearance: none;
  padding-right: 2rem; line-height: 1.25;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2316222A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.7rem center; background-size: 0.7rem auto;
}
select:focus-visible { outline: 3px solid var(--water); outline-offset: 1px; }
@media (pointer: coarse) { select { min-height: 44px; height: 44px; } }
.sort { flex-wrap: wrap; max-width: 100%; }
select { max-width: 100%; min-width: 0; }

/* ---------- Add to Home Screen / notifications banner ---------- */
.pwa-banner {
  position: fixed; z-index: 30; left: 0.75rem; right: 0.75rem; bottom: calc(0.75rem + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 0.75rem; align-items: start;
  padding: 0.9rem 0.6rem 0.75rem 0.9rem; max-width: 34rem; margin-inline: auto;
  background: #FFFFFF; color: var(--ink); border-radius: 16px; box-shadow: 0 0.75rem 2.5rem rgba(22, 34, 42, 0.22), 0 0.1rem 0.3rem rgba(22, 34, 42, 0.12);
  transition: opacity 260ms var(--ease-out), transform 360ms var(--ease-drawer);
}
@starting-style { .pwa-banner { opacity: 0; transform: translateY(calc(100% + 1rem)); } }
.pwa-banner.leaving { opacity: 0; transform: translateY(calc(100% + 1rem)); transition-duration: 200ms; }
.pwa-icon { width: 48px; height: 48px; border-radius: 11px; }
.pwa-text h2 { font-size: var(--s0); font-weight: 800; margin: 0.1rem 0 0.2rem; }
.pwa-text p { margin: 0; font-size: var(--s-1); color: var(--muted); }
.pwa-text p b { color: var(--ink); }
.pwa-actions { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: center; margin-top: 0.6rem !important; }
.pwa-status:empty { display: none; }
.pwa-status { color: var(--wood) !important; font-weight: 600; margin-top: 0.35rem !important; }
.pwa-close { width: 44px; height: 44px; display: grid; place-items: center; margin: -0.5rem -0.2rem 0 0; background: none; border: 0; color: var(--muted); border-radius: 22px; cursor: pointer; }
.pwa-close svg { width: 14px; height: 14px; }
.pwa-close:active { background: var(--paper-deep); }
.ios-share { width: 0.85em; height: 1.05em; vertical-align: -0.15em; color: var(--water); }
@media (prefers-reduced-motion: reduce) {
  .pwa-banner, .pwa-banner.leaving { transform: none !important; }
  @starting-style { .pwa-banner { transform: none; } }
}

/* ---------- Phones: put the numbers first ---------- */
/* Key figures under the member's name; each jumps to its section. */
.head-facts { list-style: none; margin: 1.1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.head-facts a {
  display: flex; flex-direction: column; justify-content: center; min-height: 44px; padding: 0.45rem 0.8rem;
  border: 1px solid var(--rule); border-radius: 12px; background: color-mix(in srgb, var(--paper) 60%, white);
  color: var(--muted); font-size: var(--s-1); line-height: 1.25; text-decoration: none;
  transition: border-color 150ms ease, transform 160ms var(--ease-out);
}
.head-facts b { color: var(--ink); font-size: var(--s1); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.head-facts a:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .head-facts a:hover { border-color: var(--ink); } }

.map-toggle { display: none; }

@media (max-width: 51.99rem) {
  /* The outline sits small beside the name instead of filling the first screen; tap it to enlarge. */
  .riding-head { grid-template-columns: minmax(0, 1fr) 5.75rem; column-gap: 1rem; row-gap: 0; align-items: start; padding-top: 1rem; }
  .riding-head > div { display: contents; }
  .riding-head > div > * { grid-column: 1 / -1; }
  .riding-head > div > .prov, .riding-head > div > h1 { grid-column: 1; }
  .riding-head figure { order: 0; grid-column: 2; grid-row: 1 / span 2; align-self: center; position: relative; }
  .riding-head .shape { width: 5.75rem; padding: 0.3rem; border-radius: 12px; background: color-mix(in srgb, var(--paper) 55%, white); border: 1px solid var(--rule); }
  .riding-head.map-open .shape { padding: 0; background: none; border: 0; }
  .riding-head figcaption { display: none; }
  .map-toggle {
    display: block; position: absolute; inset: -0.25rem; border: 0; border-radius: 12px; cursor: zoom-in;
    background: no-repeat right 0.1rem bottom 0.1rem / 1.5rem url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%23F2F4F1' stroke='%23C9D2CF'/%3E%3Cpath d='M8 12h8M12 8v8' stroke='%2316222A' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  }
  .riding-head.map-open figure { grid-column: 1 / -1; grid-row: 3; justify-self: start; margin: 1.25rem 0 0.25rem; }
  .riding-head.map-open .shape { width: min(100%, 20rem); }
  .riding-head.map-open figcaption { display: block; }
  .riding-head.map-open .map-toggle { cursor: zoom-out; background-position: right 0.1rem top 0.1rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%23F2F4F1' stroke='%23C9D2CF'/%3E%3Cpath d='M8 12h8' stroke='%2316222A' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); }
  .riding-head h1 { font-size: clamp(2rem, 9.5vw, 3rem); }
  .head-facts { margin-top: 1rem; }
  .head-facts li { flex: 1 1 8.5rem; }
}

/* Section tabs: fade the edge that has more tabs past it. */
.page-nav ul.fade-r { mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); }
.page-nav ul.fade-l { mask-image: linear-gradient(to right, transparent, #000 2.5rem); }
.page-nav ul.fade-l.fade-r { mask-image: linear-gradient(to right, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent); }

/* Spending tables: one stacked block per quarter instead of a wide table to scroll sideways. */
@media (max-width: 39.99rem) {
  .table-wrap:has(td[data-label]) { overflow: visible; margin: 0; padding: 0; }
  .table-wrap:has(td[data-label]) table { min-width: 0; }
  .table-wrap:has(td[data-label]) :is(table, tbody, tfoot, tr, th, td) { display: block; }
  .table-wrap:has(td[data-label]) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table-wrap:has(td[data-label]) caption { display: block; }
  .table-wrap:has(td[data-label]) tr { padding: 0.8rem 0; border-bottom: 1px solid var(--rule); }
  .table-wrap:has(td[data-label]) tr.fy-break { border-top: 2px solid var(--ink); }
  .table-wrap:has(td[data-label]) th[scope="row"] { font-weight: 800; font-size: var(--s0); padding: 0 0 0.3rem; border: 0; }
  .table-wrap:has(td[data-label]) td { display: flex; justify-content: space-between; gap: 1rem; padding: 0.2rem 0; border: 0; font-variant-numeric: tabular-nums; }
  .table-wrap:has(td[data-label]) td::before { content: attr(data-label); color: var(--muted); text-align: left; }
  .table-wrap:has(td[data-label]) td:last-child { margin-top: 0.2rem; padding-top: 0.35rem; border-top: 1px dashed var(--rule); }
  .table-wrap:has(td[data-label]) tfoot tr { border-bottom: 0; background: color-mix(in srgb, var(--paper) 60%, white); padding: 0.8rem 0.75rem; border-radius: 12px; margin-top: 0.75rem; }
}
