/* Society: the original Society styling (owner decision 24, ticket 226).
   Tokens are ported from design/society-reference/society-input.css: zinc
   near-black by default with a jade accent, and the original light theme.
   Two deliberate departures, for WCAG AA only: filled buttons use a deeper
   jade under white text (--primary-strong), and jade text on the light
   theme is darkened (--primary-text). Light muted text is darkened from
   46.1% to 42% lightness so it passes 4.5:1 on the elevated surfaces too
   (4.4:1 before; ticket 407). Everything else is the original. */

/* ── Self-hosted fonts: DM Sans (body/UI), Outfit (headings). Indigenous
   orthography the latin subsets lack falls back to "Society Orthography"
   (a Noto Sans subset) and Noto Sans Canadian Aboriginal (syllabics).
   Every face declares a single weight: a weight range on the latin-ext face
   would win the match for that weight and leave plain latin text to the
   fallback font. ── */
@font-face { font-family: "DM Sans"; src: url("/brand/fonts/dm-sans/dm-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; 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; }
@font-face { font-family: "DM Sans"; src: url("/brand/fonts/dm-sans/dm-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; 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; }
@font-face { font-family: "DM Sans"; src: url("/brand/fonts/dm-sans/dm-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; 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; }
@font-face { font-family: "DM Sans"; src: url("/brand/fonts/dm-sans/dm-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; 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; }
@font-face { font-family: "DM Sans"; src: url("/brand/fonts/dm-sans/dm-sans-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; 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; }
@font-face { font-family: "DM Sans"; src: url("/brand/fonts/extra/dm-sans-latin-ext-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: "DM Sans"; src: url("/brand/fonts/extra/dm-sans-latin-ext-400.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: "DM Sans"; src: url("/brand/fonts/extra/dm-sans-latin-ext-400.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: "DM Sans"; src: url("/brand/fonts/extra/dm-sans-latin-ext-400.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: "Outfit"; src: url("/brand/fonts/outfit/outfit-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; 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; }
@font-face { font-family: "Outfit"; src: url("/brand/fonts/outfit/outfit-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; 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; }
@font-face { font-family: "Outfit"; src: url("/brand/fonts/extra/outfit-latin-ext-700.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: "Outfit"; src: url("/brand/fonts/extra/outfit-latin-ext-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: "Society Orthography"; src: url("/brand/fonts/extra/society-orthography-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Society Orthography"; src: url("/brand/fonts/extra/society-orthography-400.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Society Orthography"; src: url("/brand/fonts/extra/society-orthography-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Society Orthography"; src: url("/brand/fonts/extra/society-orthography-600.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Noto Sans Canadian Aboriginal"; src: url("/brand/fonts/extra/noto-sans-canadian-aboriginal-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+02C7, U+02D8-02D9, U+02DB, U+0307, U+1400-167F, U+18B0-18F5, U+25CC, U+11AB0-11ABF; }

/* ═══ Tokens: dark (default) ═══ */
:root, [data-theme="dark"] {
  --background: hsl(240 10% 3.9%);
  --foreground: hsl(0 0% 98%);
  --card: hsl(240 10% 5.5%);
  --card-foreground: hsl(0 0% 98%);
  --elevated: hsl(240 8% 9%);
  --primary: hsl(160 84% 39%);
  --primary-foreground: hsl(0 0% 100%);
  --secondary: hsl(240 3.7% 15.9%);
  --muted: hsl(240 3.7% 15.9%);
  --muted-foreground: hsl(240 5% 64.9%);
  --border: hsl(240 3.7% 15.9%);
  --input: hsl(240 3.7% 15.9%);
  --ring: hsl(160 84% 39%);
  --destructive: hsl(0 62.8% 30.6%);
  --jade: hsl(160 84% 42%);
  --rose: hsl(347 77% 60%);
  --orange: hsl(25 90% 62%);

  /* Derived (AA): white text on jade needs a deeper fill. */
  --primary-strong: hsl(160 84% 28%);
  --primary-strong-hover: hsl(160 84% 31%);
  --primary-text: var(--primary);
  --primary-soft: color-mix(in srgb, var(--primary) 14%, transparent);
  --soon: var(--orange);
  --soon-soft: color-mix(in srgb, var(--orange) 14%, transparent);
  --ok: var(--primary-text);
  --ok-soft: var(--primary-soft);
  --danger-text: hsl(347 77% 68%);

  --glass-bg: hsla(240 10% 6% / 0.7);
  --glass-blur: 20px;
  --glass-border: hsla(0 0% 100% / 0.06);
  --feed-card-shadow: 0 2px 8px hsl(0 0% 0% / 0.36), 0 18px 48px -16px hsl(0 0% 0% / 0.64);
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-popover: 0 8px 28px rgba(0, 0, 0, 0.4);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.5);
  --map-bg: #0B0B0E;
  color-scheme: dark;
}

/* ═══ Tokens: light ═══ */
[data-theme="light"] {
  --background: hsl(0 0% 100%);
  --foreground: hsl(240 10% 3.9%);
  --card: hsl(0 0% 98%);
  --card-foreground: hsl(240 10% 3.9%);
  --elevated: hsl(240 5% 96%);
  --primary: hsl(160 84% 36%);
  --primary-foreground: hsl(0 0% 100%);
  --secondary: hsl(240 4.8% 95.9%);
  --muted: hsl(240 4.8% 95.9%);
  --muted-foreground: hsl(240 3.8% 42%);
  --border: hsl(240 5.9% 90%);
  --input: hsl(240 5.9% 90%);
  --ring: hsl(160 84% 36%);
  --destructive: hsl(0 72.2% 50.6%);
  --jade: hsl(160 84% 32%);
  --rose: hsl(347 70% 48%);
  --orange: hsl(25 85% 46%);

  --primary-text: hsl(160 84% 24%);
  --primary-soft: color-mix(in srgb, var(--primary) 12%, transparent);
  --soon: hsl(25 85% 36%);
  --soon-soft: color-mix(in srgb, var(--orange) 12%, transparent);
  --danger-text: hsl(347 70% 42%);

  --glass-bg: hsla(0 0% 100% / 0.65);
  --glass-border: hsla(0 0% 0% / 0.06);
  --feed-card-shadow: 0 1px 3px hsl(240 15% 30% / 0.08), 0 12px 32px -10px hsl(240 15% 30% / 0.16);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-popover: 0 8px 28px rgba(0, 0, 0, 0.07);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.18);
  --map-bg: #E4E8EC;
  color-scheme: light;
}

:root {
  --radius: 0.75rem;
  --font-sans: "DM Sans", "Society Orthography", "Noto Sans Canadian Aboriginal", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Outfit", "DM Sans", "Society Orthography", "Noto Sans Canadian Aboriginal", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --topbar: 52px;
  --rail: 0px;
  /* One spacing scale (ticket 407): 4, 8, 16, 24, 40, 64. Sections sit
     40 apart; things inside a card 16 apart. */
  --space-1: 4px; --space-2: 8px; --space-3: 16px; --space-4: 24px; --space-5: 40px; --space-6: 64px;
  --section-gap: var(--space-5);
  /* Reading width: about 70 characters a line. */
  --measure: 680px;
  /* Secondary text is never smaller than 14px. */
  --text-secondary: 0.875rem;
}
@media (min-width: 760px) { :root { --topbar: 0px; --rail: 88px; } }
@media (min-width: 1100px) { :root { --rail: 208px; } }

/* ═══ Base ═══ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--background); }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--font-sans); font-size: 16px; line-height: 1.5;
  color: var(--foreground); background: var(--background);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}
main { flex: 1; outline: none; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.35rem); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 var(--space-2); }
a { color: var(--primary-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
::selection { background-color: var(--primary); color: var(--primary-foreground); }
.tnum, time, .num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted-foreground); }
.strong { font-weight: 600; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
/* Spam trap on the feedback forms (ticket 481): people never see it. */
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.skip {
  position: absolute; left: 12px; top: -48px; z-index: 3000;
  background: var(--primary-strong); color: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 600;
}
.skip:focus { top: 8px; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted-foreground) 30%, transparent); border-radius: 999px; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ═══ Brand ═══ */
.wordmark {
  font-family: var(--font-heading); font-weight: 700; letter-spacing: -0.03em; line-height: 1;
  font-size: 1.4rem; color: var(--foreground); text-decoration: none;
}
.wordmark .dot { color: var(--primary); }
.wordmark.small { font-size: 1rem; }
.preview-chip {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 500; white-space: nowrap;
  color: var(--muted-foreground); text-decoration: none;
  background: color-mix(in srgb, var(--elevated) 70%, transparent); border: 1px solid var(--border);
}
.preview-chip:hover { color: var(--foreground); }
.pip { width: 7px; height: 7px; border-radius: 999px; background: var(--jade); box-shadow: 0 0 8px 1px var(--jade); flex: none; }

/* ═══ Left nav rail (desktop) ═══ */
.rail { display: none; }
@media (min-width: 760px) {
  .rail {
    position: fixed; z-index: 1600; top: 0; bottom: 0; left: 0; width: var(--rail);
    display: flex; flex-direction: column; gap: 4px; padding: 16px 12px 12px; overflow-y: auto;
    background: var(--background); border-right: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  }
  .rail-brand { display: flex; flex-direction: column; gap: 10px; padding: 6px 12px 14px; }
  .rail-group { display: flex; flex-direction: column; gap: 2px; }
  .rail-more { margin-top: 24px; }
  .rail-foot { margin-top: auto; padding-top: 16px; }
  .rail-link {
    position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 8px 12px; min-height: 44px; border-radius: 12px; border: 0; background: none; cursor: pointer;
    font: inherit; font-size: 15px; font-weight: 500; text-align: left;
    color: var(--muted-foreground); text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  }
  .rail-link .icon { width: 24px; height: 24px; }
  .rail-link:hover { background: var(--elevated); color: var(--foreground); }
  .rail-link[aria-current="page"] {
    background: var(--elevated); color: var(--foreground);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  }
  .rail-link[aria-current="page"] .icon { color: var(--primary); }
  .frame { margin-left: var(--rail); }
}
/* Tablets: a narrow rail with each label under its icon, like the phone
   tab bar, so first-time visitors can tell what each one does (ticket 413).
   From 1100px the labels sit beside the icons. */
@media (min-width: 760px) and (max-width: 1099px) {
  .rail { padding: 14px 6px; align-items: center; }
  .rail-brand { padding: 4px 0 12px; align-items: center; }
  .rail-brand .wordmark { font-size: 1.05rem; }
  .rail-brand .preview-chip { padding: 2px 7px; font-size: 0.68rem; }
  .rail-link { width: 76px; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 2px; min-height: 56px; font-size: 12px; text-align: center; line-height: 1.2; }
  .rail-link .icon { width: 22px; height: 22px; }
  .rail-foot .theme-label {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
}

/* ═══ Phone top bar and frosted floating tab bar ═══ */
.topbar {
  position: sticky; top: 0; z-index: 1600;
  height: var(--topbar); display: flex; align-items: center; gap: 10px;
  padding: 0 max(16px, env(safe-area-inset-left));
  background: var(--glass-bg); -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
}
.topbar .wordmark { font-size: 1.3rem; }
.topbar .preview-chip { align-self: center; }
.theme-toggle .icon-moon, [data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }
.topbar-toggle {
  margin-left: auto; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 999px; border: 0; background: none; cursor: pointer;
  color: var(--muted-foreground); transition: background-color 0.2s, color 0.2s, transform 0.15s;
}
.topbar-toggle:hover { background: var(--elevated); color: var(--foreground); }
.topbar-toggle:active { transform: scale(0.97); }
.topbar-toggle .theme-label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.frame { display: flex; flex-direction: column; min-height: calc(100vh - var(--topbar)); }
.tabbar { display: none; }
@media (min-width: 760px) { .topbar { display: none; } }

.footer {
  padding: 24px 20px 32px; border-top: 1px solid var(--border);
  color: var(--muted-foreground); font-size: 0.875rem; text-align: center;
}
.footer p { margin: 0 0 8px; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 20px; }
.footer a { color: var(--muted-foreground); text-decoration: none; }
.footer a:hover { color: var(--foreground); text-decoration: underline; }
.home-page.no-place .footer { display: none; }

/* ═══ Buttons: pills that press to 0.97 and glow ═══ */
button { font: inherit; color: inherit; }
.button, button.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-size: 0.95rem; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition-property: background-color, border-color, color, box-shadow, opacity, transform;
  transition-duration: 150ms; transition-timing-function: ease;
  transform: translateZ(0) scale(1);
}
.button:hover:not(:disabled) { transform: translateZ(0) scale(1.01); }
.button:active:not(:disabled) { transform: translateZ(0) scale(0.97); }
@media (hover: none) { .button:hover:not(:disabled) { transform: translateZ(0) scale(1); } }
.button.primary, .button.on-dark {
  background: var(--primary-strong); color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 30%, transparent);
}
.button.primary:hover, .button.on-dark:hover { background: var(--primary-strong-hover); box-shadow: 0 0 20px -2px var(--primary); }
.button.secondary { background: transparent; color: var(--foreground); border-color: var(--border); }
.button.secondary:hover { background: color-mix(in srgb, var(--muted) 60%, transparent); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.button.small { min-height: 36px; padding: 6px 14px; font-size: 0.875rem; font-weight: 500; }
button.link {
  border: 0; background: none; padding: 0; color: var(--primary-text); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; font: inherit;
}
button:disabled { opacity: 0.5; cursor: default; }

.feedback-fab {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 1500;
  min-height: 40px; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: 0.875rem; font-weight: 500;
  color: var(--muted-foreground); background: var(--glass-bg); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-popover); transition: color 0.2s, border-color 0.2s, transform 0.15s;
}
.feedback-fab:hover { color: var(--foreground); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.feedback-fab:active { transform: scale(0.97); }

/* ═══ Home (Governs) ═══ */
.home { display: grid; }
.picker { position: relative; isolation: isolate; overflow: hidden; padding: 36px clamp(16px, 4vw, 40px); }
.picker > :not(.constellation) { position: relative; z-index: 1; }
.bootmark {
  display: flex; align-items: center; gap: 0.3em; margin-bottom: 18px;
  font-family: var(--font-heading); font-weight: 700; font-size: 1.6rem; letter-spacing: -0.03em; line-height: 1;
}
.bootmark svg { width: 0.8em; height: 0.8em; overflow: visible; }
.bootmark g { transform-box: fill-box; transform-origin: center; fill: var(--primary); animation: therefore 0.9s var(--ease-out) 0.5s both; }
.bootmark .dot { color: var(--primary); text-shadow: 0 0 12px var(--primary); }
@keyframes therefore { from { transform: rotate(0deg); fill: var(--muted-foreground); } to { transform: rotate(180deg); fill: var(--primary); } }
.mission { color: var(--muted-foreground); margin: -6px 0 18px; font-size: 0.95rem; line-height: 1.55; max-width: 36em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px;
  padding: 6px 14px; border-radius: 999px; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.02em;
  color: var(--muted-foreground); background: color-mix(in srgb, var(--elevated) 70%, transparent); border: 1px solid var(--border);
}
.hero-title { font-size: clamp(2.1rem, 4.5vw, 2.9rem); font-weight: 700; letter-spacing: -0.03em; }
.lede { color: var(--muted-foreground); margin: 12px 0 22px; font-size: 1.05rem; line-height: 1.6; max-width: 34em; }
.search { display: flex; gap: 8px; }
.search input {
  flex: 1; min-width: 0; min-height: 48px; padding: 10px 18px;
  font: inherit; color: var(--foreground); background: var(--elevated);
  border: 1px solid var(--border); border-radius: 999px; transition: border-color 0.2s, box-shadow 0.2s;
}
.search input::placeholder { color: var(--muted-foreground); }
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.search .button { min-height: 48px; }
.search-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; color: var(--muted-foreground); }
.search-extra button.link, .hint button.link { padding: 6px 0; }
.hint { color: var(--muted-foreground); font-size: 0.875rem; margin-top: 14px; }
.privacy { font-size: var(--text-secondary); }
.matches {
  list-style: none; margin: 12px 0 0; overflow: hidden; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-popover);
}
.matches li + li { border-top: 1px solid var(--border); }
.matches button.match {
  display: block; width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 12px 16px; font-size: 0.95rem; color: var(--foreground); transition: background-color 0.15s;
}
.matches button.match:hover, .matches button.match:focus-visible { background: var(--elevated); outline-offset: -3px; }
.match-status { display: block; padding: 12px 16px; color: var(--muted-foreground); font-size: 0.95rem; }
.match-name { display: block; font-weight: 500; }
.match-also { font-weight: 400; color: var(--muted-foreground); }
.match-meta { display: block; margin-top: 2px; font-size: var(--text-secondary); color: var(--muted-foreground); }
.match-prompt { padding: 14px 16px; }
.match-prompt p { margin: 0 0 8px; }
.match-prompt-title { font-family: var(--font-heading, inherit); font-weight: 600; font-size: 1.05rem; }
.match-prompt-title:focus { outline: none; }
.match-prompt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 0 !important; }
.boundary-hint .plain-list { margin: 6px 0 0; }
.boundary-hint button.link { padding: 2px 0; }

/* The constellation backdrop on the home hero (ConstellationBackdrop.tsx):
   nodes hug the edges, assemble, then dim to a backdrop behind a radial
   scrim. Decorative only. The node hues are the original's palette. */
.constellation {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none;
  --c-fact: hsl(172 66% 50%); --c-query: hsl(199 89% 60%); --c-policy: hsl(217 91% 68%);
  --c-defn: hsl(263 70% 70%); --c-law: hsl(43 96% 62%); --c-value: hsl(330 75% 65%);
  animation: constellation-dim 1.6s var(--ease-out) both;
}
[data-theme="light"] .constellation {
  --c-fact: hsl(172 66% 36%); --c-query: hsl(199 89% 42%); --c-policy: hsl(217 70% 50%);
  --c-defn: hsl(263 55% 52%); --c-law: hsl(43 80% 40%); --c-value: hsl(330 65% 48%);
}
.constellation line { stroke: color-mix(in srgb, var(--primary) 22%, transparent); stroke-width: 1.5; animation: fade-to-70 0.5s ease-out both; animation-delay: calc(240ms + var(--i) * 35ms); }
.constellation circle { transform-box: fill-box; transform-origin: center; animation: node-in 0.6s var(--spring) both; animation-delay: calc(var(--i) * 65ms); }
.constellation .fact { fill: var(--c-fact); } .constellation .query { fill: var(--c-query); }
.constellation .policy { fill: var(--c-policy); } .constellation .defn { fill: var(--c-defn); }
.constellation .law { fill: var(--c-law); } .constellation .value { fill: var(--c-value); }
.picker::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(60% 55% at 50% 45%,
    color-mix(in srgb, var(--background) 82%, transparent),
    color-mix(in srgb, var(--background) 35%, transparent) 100%);
}
@keyframes node-in { from { opacity: 0; transform: scale(0.2); } to { opacity: 1; transform: scale(1); } }
@keyframes fade-to-70 { from { opacity: 0; } to { opacity: 0.7; } }
@keyframes constellation-dim { 0% { opacity: 0; } 25% { opacity: 1; } 55% { opacity: 1; } 100% { opacity: 0.55; } }

.map-wrap { position: relative; background: var(--map-bg); }
#map { width: 100%; height: 100%; background: var(--map-bg); }
.leaflet-container { background: var(--map-bg); font-family: var(--font-sans); }
.leaflet-bar { border: 1px solid var(--border) !important; border-radius: 12px !important; overflow: hidden; box-shadow: var(--shadow-popover) !important; }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--card); color: var(--foreground); border-bottom-color: var(--border); }
.leaflet-bar a:hover { background: var(--elevated); }
.leaflet-bar a.leaflet-disabled { background: var(--card); color: var(--muted-foreground); opacity: 0.5; }
.leaflet-container .leaflet-control-attribution {
  background: color-mix(in srgb, var(--background) 78%, transparent); color: var(--muted-foreground);
  border-top-left-radius: 8px; font-size: 0.7rem;
}
.leaflet-container .leaflet-control-attribution a { color: var(--muted-foreground); }
.leaflet-tooltip { background: var(--card); color: var(--foreground); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-popover); }
.leaflet-tooltip-top::before { border-top-color: var(--card); }
.leaflet-tooltip-bottom::before { border-bottom-color: var(--card); }
.leaflet-tooltip-left::before { border-left-color: var(--card); }
.leaflet-tooltip-right::before { border-right-color: var(--card); }
path.place-outline { stroke: var(--primary); fill: var(--primary); }
path.demand-cell { stroke: var(--soon); fill: var(--soon); }
/* The chosen spot: a jade dot that glows (glow-dot). */
.pin { display: grid; place-items: center; }
.pin span {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary); border: 3px solid #fff;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 28%, transparent), 0 0 12px 2px var(--primary);
}
.basemap-note {
  position: absolute; left: 8px; right: 8px; bottom: 28px; z-index: 500; margin: 0;
  padding: 6px 12px; border-radius: 10px; background: var(--glass-bg); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--border); color: var(--muted-foreground); font-size: var(--text-secondary); pointer-events: none;
}
.map-fit, .has-place.map-expanded .map-fit {
  position: absolute; z-index: 1000; left: 50%; transform: translateX(-50%); top: 12px; max-width: calc(100% - 100px);
  min-height: 36px; padding: 6px 14px; border-radius: 999px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.85rem; font-weight: 500; color: var(--foreground);
  background: var(--glass-bg); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: var(--shadow-popover);
}
.map-toggle {
  position: absolute; z-index: 1000; top: 12px; right: 12px;
  min-height: 44px; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: 0.875rem; color: var(--foreground);
  background: var(--glass-bg); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: var(--shadow-popover); transition: transform 0.15s, border-color 0.2s;
}
.map-toggle:hover { border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.map-toggle:active { transform: scale(0.97); }
.results { padding: 0 clamp(16px, 4vw, 40px); }
.results:empty { display: none; }

/* Before a place is chosen: the picker and a large map. */
.no-place .home { grid-template-columns: minmax(320px, 460px) minmax(0, 1fr); min-height: calc(100vh - var(--topbar)); }
.no-place .picker { grid-column: 1; grid-row: 1; border-right: 1px solid var(--border); }
.no-place .side { grid-column: 2; grid-row: 1 / span 2; height: calc(100vh - var(--topbar)); position: sticky; top: var(--topbar); }
.no-place .map-wrap { height: 100%; }
.no-place .side-reps { display: none; }
.no-place .results { grid-column: 1; grid-row: 2; border-right: 1px solid var(--border); padding-bottom: 24px; }

/* After: the answer leads; the right column holds the map and "Your
   representatives", sticky while the answer scrolls (ticket 409). */
.has-place .home {
  grid-template-columns: minmax(0, 1fr) 340px; gap: 0 28px;
  max-width: 1180px; width: 100%; margin: 0 auto; padding: 28px 24px 48px;
  grid-template-areas: "picker picker" "results side";
  align-items: start;
}
.has-place .side {
  grid-area: side; position: sticky; top: calc(var(--topbar) + 20px);
  display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - var(--topbar) - 96px);
}
.side-reps { display: flex; flex-direction: column; min-height: 0; }
.side-reps:empty { display: none; }
.has-place .picker { display: none; grid-area: picker; }
.has-place .constellation, .has-place .picker::after, .has-place .bootmark, .has-place .mission, .has-place .eyebrow { display: none; }
.has-place.picker-open .picker {
  display: block; overflow: visible; margin-bottom: 20px; padding: 20px;
  background: color-mix(in srgb, var(--card) 80%, transparent); border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  border-radius: var(--radius); box-shadow: var(--shadow-soft);
  animation: fade-in-scale 0.25s ease-out both;
}
.has-place .hero-title, .has-place .lede { display: none; }
.has-place .results { grid-area: results; padding: 0; }
.has-place .map-wrap {
  flex: none; height: 240px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--feed-card-shadow);
}
.has-place.map-expanded .side { z-index: 1550; }
.has-place.map-expanded .map-wrap {
  position: fixed; z-index: 1550; inset: var(--topbar) 0 0 var(--rail); height: auto; border-radius: 0; border: 0;
}
/* Narrow tablets and phones: one column. home.js moves the map under the
   heading and the representatives after the cards. */
@media (max-width: 979px) {
  .has-place .home { grid-template-columns: minmax(0, 1fr); grid-template-areas: "picker" "results" "side"; }
  .has-place .side { position: static; max-height: none; }
  .has-place .map-wrap { height: 220px; }
  .has-place .side > .map-wrap { margin-top: 16px; }
  .map-slot > .map-wrap { margin-bottom: 16px; }
}

.loading .results > :not(.skeleton) { opacity: 0.5; transition: opacity 0.15s; }
.skeleton {
  height: 84px; border-radius: var(--radius); margin-bottom: 10px;
  background: linear-gradient(90deg, var(--card) 25%, var(--elevated) 50%, var(--card) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
.skeleton.tall { height: 64px; width: 60%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* The heading and the place chip share a row; the subtitle runs the full
   width below them (ticket 413). */
.answer-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title chip" "sub sub";
  align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-4);
}
.answer-head h1 { grid-area: title; font-size: clamp(1.9rem, 4vw, 2.5rem); }
.answer-head .chip { grid-area: chip; max-width: 100%; }
.answer-sub { grid-area: sub; color: var(--muted-foreground); margin: 0; font-size: 1.05rem; max-width: var(--measure); }
.answer-head h1:focus { outline: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none; max-width: 50%; min-width: 0;
  min-height: 40px; padding: 6px 16px 6px 12px; border-radius: 999px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); color: var(--foreground); font-weight: 500; font-size: 0.92rem;
  transition: border-color 0.2s, background-color 0.2s, transform 0.15s;
}
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .icon { width: 18px; height: 18px; color: var(--primary); }
.chip:hover { border-color: color-mix(in srgb, var(--primary) 40%, transparent); background: var(--elevated); }
.chip:active { transform: scale(0.97); }

/* Upcoming votes: a card lit with the accent. */
.banner {
  display: block;
  padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 14%, var(--card)), var(--card) 70%);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
  box-shadow: 0 0 28px -14px var(--primary);
  animation: fade-in 0.3s ease-out both;
}
.banner p { margin: 0; }
.banner-title { font-family: var(--font-heading); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.02em; }
.banner-sub { color: var(--muted-foreground); font-size: 0.92rem; margin-top: 2px !important; }
.banner-sub a { color: var(--primary-text); }
/* Every vote in the next 30 days, in date order (#170). */
.banner-votes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; flex: 1; min-width: 0; }
.banner-multi .banner-vote + .banner-vote { border-top: 1px solid var(--border); padding-top: 12px; }
/* One row per vote (ticket 410): countdown, title and date, ballot, button. */
.banner-vote { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; gap: 4px 16px; align-items: start; }
.banner-count { font-family: var(--font-heading); font-weight: 700; font-size: 1.6rem; line-height: 1.1; letter-spacing: -0.03em; color: var(--soon); font-variant-numeric: tabular-nums; }
.banner-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.banner-title { font-size: 1.12rem; }
.banner-date { color: var(--foreground); font-weight: 500; }
.banner-button { align-self: center; }
.banner-details { margin-top: 4px; font-size: 0.9rem; }
.banner-details > summary { cursor: pointer; color: var(--primary-text); font-weight: 500; min-height: 32px; display: inline-flex; align-items: center; }
.banner-detail { color: var(--muted-foreground); margin: 4px 0 0 !important; }
.banner-detail a { color: var(--primary-text); }

/* Section labels: 12px, semibold, uppercase, wider tracking, muted. */
.section-label {
  font-family: var(--font-sans); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted-foreground); margin: var(--section-gap) 0 var(--space-2);
}
.cards { list-style: none; display: grid; gap: var(--space-3); }
/* Glass cards: rounded-xl, border/60, card/80, backdrop blur, shadow-soft. */
.card {
  display: block; padding: var(--space-3) var(--space-4); border-radius: var(--radius);
  background: color-mix(in srgb, var(--card) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  box-shadow: var(--shadow-soft); color: var(--foreground); text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
[data-theme="dark"] .card { border-color: var(--border); }
.card:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); box-shadow: var(--shadow-md); }
.card.active { border-color: color-mix(in srgb, var(--primary) 60%, transparent); box-shadow: 0 0 12px -2px var(--primary); }
.card-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.level {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-foreground);
  margin: 0;
}
.vote-tag { margin-left: auto; font-size: var(--text-secondary); font-weight: 600; color: var(--foreground); font-variant-numeric: tabular-nums; }
.vote-tag.soon { color: var(--soon); }
.vote-tag.none { font-weight: 400; color: var(--muted-foreground); }
.card-title { display: block; font-weight: 600; font-size: 1.06rem; margin-top: var(--space-1); line-height: 1.3; letter-spacing: -0.01em; }
.card-line { display: block; margin-top: 4px; font-size: 0.93rem; color: var(--muted-foreground); }
.card-rule { display: block; margin-top: var(--space-2); font-size: var(--text-secondary); line-height: 1.45; }
.card-line .who { color: var(--foreground); }
/* Home cards in fixed rows (ticket 408): the name links to the body and
   covers the card; people's names are links above it. */
div.card { position: relative; }
a.card-link { color: var(--foreground); text-decoration: none; }
a.card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
a.card-link:focus-visible { outline: none; }
.card:has(a.card-link:focus-visible) { outline: 2px solid var(--ring, var(--primary)); outline-offset: 2px; }
.card:hover a.card-link { color: var(--primary-text); }
.card-row { display: block; margin-top: var(--space-2); font-size: 0.9375rem; line-height: 1.5; }
.card-row .row-label { color: var(--muted-foreground); }
.card-row a { position: relative; z-index: 1; color: var(--foreground); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--foreground) 35%, transparent); text-underline-offset: 2px; }
.card-row a:hover { color: var(--primary-text); text-decoration-color: currentColor; }
.card .vote-tag, .card .badge { position: relative; }
.card-note { display: block; margin-top: 4px; font-size: 0.875rem; color: var(--muted-foreground); }
.badge {
  font-size: 0.72rem; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: var(--soon-soft); color: var(--soon); letter-spacing: 0; text-transform: none;
}

.notice {
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: var(--radius); padding: var(--space-3); margin: var(--space-3) 0; font-size: 0.95rem;
}
.notice p:last-child { margin-bottom: 0; }

.block {
  background: color-mix(in srgb, var(--card) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  border-radius: var(--radius); box-shadow: var(--shadow-soft);
  padding: var(--space-4); margin: var(--section-gap) 0;
}
[data-theme="dark"] .block { border-color: var(--border); }
/* Headings sit with what they introduce: more space above than below. */
.block > h2 { margin-bottom: var(--space-3); }
.block h3 { margin-bottom: var(--space-2); }
.block :is(p, ul, ol, dl, div, details) + h3 { margin-top: var(--space-4); }
.block > h2 a { color: inherit; }
.places .place-chain, .treaties .place-chain { list-style: none; display: grid; gap: 6px; }
.treaties .treaty-note { font-size: var(--text-secondary); margin: var(--space-3) 0 0; }
.places .places-sub { font-family: var(--font-sans); font-size: 0.95rem; font-weight: 600; margin: var(--space-4) 0 var(--space-2); }
.report-line { color: var(--muted-foreground); font-size: var(--text-secondary); margin: var(--space-3) 0 0; }

/* Feed-style person rows: avatar, then name and meta (FeedClaimCard). */
.people { list-style: none; display: grid; gap: 4px; }
.people > .person-row { padding: var(--space-2) 0; }
.people > .person-row + .person-row { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.person-row { display: flex; gap: 12px; align-items: flex-start; }
.person-name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
a.person-name { color: var(--foreground); text-decoration: none; }
a.person-name:hover { color: var(--primary-text); text-decoration: underline; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  background: var(--primary-soft); color: var(--primary-text);
  font-family: var(--font-heading); font-weight: 600; font-size: 0.9rem; letter-spacing: -0.01em;
}
.avatar.large { width: 72px; height: 72px; font-size: 1.5rem; }
.sub { display: block; color: var(--muted-foreground); font-size: 0.875rem; line-height: 1.45; margin-top: 1px; }
.party {
  display: inline-block; font-size: 0.75rem; font-weight: 500; padding: 1px 8px; margin-left: 6px;
  border-radius: 999px; border: 1px solid var(--border); color: var(--muted-foreground); vertical-align: 1px;
}

/* ═══ Content pages ═══ */
.page { max-width: 820px; width: 100%; margin: 0 auto; padding: var(--space-4) var(--space-4) var(--space-6); }
.page.narrow { max-width: 580px; }
/* Reading text stays under about 70 characters a line (ticket 407). */
.page p, .page dd, .page .page-sub { max-width: var(--measure); }
.prose-page .block :is(ul, ol) { max-width: var(--measure); }
.page .block :is(ul, ol) + p { margin-top: var(--space-2); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-1); font-size: var(--text-secondary); color: var(--muted-foreground); margin-bottom: var(--space-3); }
.crumbs li + li::before { content: "›"; margin: 0 6px 0 2px; color: var(--muted-foreground); }
.crumbs a { color: var(--muted-foreground); text-decoration: none; }
.crumbs a:hover { color: var(--foreground); text-decoration: underline; }
.page-head { margin-bottom: var(--space-5); }
.page-head .level { margin-bottom: var(--space-2); }
.page-sub { color: var(--muted-foreground); font-size: 1.05rem; margin: var(--space-2) 0 0; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: var(--space-3) 0 var(--space-1); }

.report {
  display: inline-block; padding: 2px 0; min-height: 24px; line-height: 20px;
  font-size: var(--text-secondary); color: var(--muted-foreground); text-decoration-color: var(--border); font-weight: 400; white-space: nowrap;
}
.report:hover { color: var(--primary-text); text-decoration-color: currentColor; }
.follow-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 0; line-height: 20px;
  font-size: var(--text-secondary); color: var(--muted-foreground); text-decoration-color: var(--border); white-space: nowrap;
}
.follow-link .icon { width: 16px; height: 16px; color: var(--primary); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.follow-link .icon circle { fill: currentColor; stroke: none; }
.follow-link:hover { color: var(--primary-text); text-decoration-color: currentColor; }
.src { display: block; font-size: var(--text-secondary); color: var(--muted-foreground); margin-top: var(--space-1); }
.src a { color: var(--muted-foreground); }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* One quiet sources note and one report link per section (ticket 411). */
.section-foot {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap;
  margin-top: var(--space-3); padding-top: var(--space-2); border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.section-foot > .report { margin-left: auto; }
details.sourced { flex: 1 1 auto; min-width: 0; font-size: var(--text-secondary); color: var(--muted-foreground); }
details.sourced > summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 8px 2px 2px; border-radius: 999px;
  cursor: pointer; list-style: none; user-select: none; transition: color 0.15s, background-color 0.15s;
}
details.sourced > summary::-webkit-details-marker { display: none; }
details.sourced > summary:hover { color: var(--foreground); background: color-mix(in srgb, var(--muted) 60%, transparent); }
.info-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: none;
  border: 1px solid var(--border); border-radius: 50%; font: 600 0.7rem/1 var(--font-heading); font-style: italic; color: var(--primary-text);
}
details.sourced[open] > summary .info-icon { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.sourced-panel {
  margin-top: var(--space-2); padding: var(--space-3); border-radius: var(--radius); font-size: var(--text-secondary); line-height: 1.5;
  background: color-mix(in srgb, var(--elevated) 70%, transparent); border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.sourced-title { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; margin: 0 0 8px; }
.sourced-list { list-style: none; display: grid; gap: 8px; }
.sourced-list li { overflow-wrap: anywhere; }
.sourced-fact { display: block; color: var(--foreground); }

/* People as a grid: two or three columns on wide screens, one on phones (ticket 411). */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px; }
.people-grid > .person-row { align-items: center; padding: 6px 0; min-width: 0; }
.person-text { min-width: 0; }
.people-grid .person-name { display: block; line-height: 1.3; overflow-wrap: anywhere; }
.people-grid .sub { font-size: var(--text-secondary); }
.people-grid .party { margin-left: 4px; }

/* The five plain-language answers at the top of an authority page (ticket 427). */
.explainer-list { margin: 0; display: grid; gap: var(--space-3); }
.explainer-item + .explainer-item { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); padding-top: var(--space-3); }
.explainer-item dt {
  font-family: var(--font-sans); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted-foreground); margin: 0 0 var(--space-2);
}
.explainer-item dd { margin: 0; }
.explainer-item dd > p:first-child { margin: 0; max-width: var(--measure); }
.explainer-item .src { margin-top: var(--space-2); }
.explainer-item .applies { white-space: normal; }
.explainer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 10px 0 0; }
.explainer-links a {
  display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.875rem; line-height: 1.35;
  border: 1px solid var(--border); background: color-mix(in srgb, var(--elevated) 60%, transparent);
  color: var(--foreground); text-decoration: none; transition: border-color 0.15s, color 0.15s, transform 0.1s;
}
.explainer-links a:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); color: var(--primary-text); }
.explainer-links a:active { transform: scale(0.97); }
details.more-links > summary {
  display: inline-flex; align-items: center; min-height: 32px; margin-top: 6px; cursor: pointer; list-style: none;
  font-size: 0.875rem; font-weight: 600; color: var(--primary-text);
}
details.more-links > summary::-webkit-details-marker { display: none; }
details.more-links .when-open, details.more-links[open] .when-closed { display: none; }
details.more-links[open] .when-open { display: inline; }
details.more-links > .explainer-links { margin-top: 6px; }
/* Keep "Show fewer" under the opened list where details can be laid out (Chrome 131+). */
details.more-links[open] { display: flex; flex-direction: column-reverse; align-items: flex-start; }
dialog label[hidden] { display: none; }

.office-list, .power-list, .holders, .contest-list, .link-list, .contact { list-style: none; display: grid; gap: var(--space-3); }
.office-list > li + li, .power-list > li + li { border-top: 1px solid var(--border); padding-top: var(--space-3); }
.office-list p, .power-list p { margin: var(--space-1) 0 0; }
.holders .holders { margin-top: var(--space-2); gap: var(--space-2); }
.office-item .holders { margin-top: var(--space-2); gap: var(--space-2); }
.contest-list { gap: var(--space-3); }
/* Authority pages: later scheduled votes, folded (ticket 413). */
details.later-votes { margin-top: var(--space-3); padding-top: var(--space-2); border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
details.later-votes > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: var(--space-2); font-weight: 600; color: var(--primary-text); }
details.later-votes > summary .muted { font-weight: 400; }
details.later-votes > .contest-list { margin-top: var(--space-2); }
.link-list { gap: 8px; }
.plain-list { padding-left: 20px; display: grid; gap: 8px; }

.facts-list { margin: 0; display: grid; gap: var(--space-3); }
.facts-list div { display: grid; grid-template-columns: 9em 1fr; gap: 12px; }
.facts-list dt { color: var(--muted-foreground); }
.facts-list dd { margin: 0; }

.person-head { display: flex; gap: var(--space-3); align-items: center; margin-bottom: var(--space-3); }
.strip { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 var(--space-3); }
.strip li { background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 0.92rem; }
.days {
  display: inline-block; font-size: var(--text-secondary); font-weight: 600; padding: 1px 9px; border-radius: 999px; margin-left: 4px;
  border: 1px solid var(--border); color: var(--muted-foreground); font-variant-numeric: tabular-nums;
}
.days.soon { background: var(--soon-soft); border-color: transparent; color: var(--soon); }
.tag { font-size: 0.75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted-foreground); }
.tag-yes { background: var(--ok-soft); border-color: transparent; color: var(--ok); }

.table-wrap { overflow-x: auto; margin-top: 8px; }
.seats-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.seats-table th, .seats-table td { text-align: left; padding: 10px 10px 10px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.seats-table thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-foreground); font-weight: 600; }
.seats-table tbody th { font-weight: 500; }
.seats-table .num { text-align: right; }

.place-map { height: 320px; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; background: var(--map-bg); margin: 6px 0 2px; }
details.members { border-top: 1px solid var(--border); padding: 10px 0; }
details.members:first-of-type { border-top: 0; }
details.members summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.gap-details summary { cursor: pointer; padding: 6px 0; font-weight: 500; }
.gap-details ul { margin: 4px 0 10px; }
.respond input[type="radio"] { width: 20px; height: 20px; accent-color: var(--primary); }
.leaflet-touch .leaflet-bar a { width: 36px; height: 36px; line-height: 36px; }
.member-list { list-style: none; columns: 2 220px; column-gap: 24px; margin-top: 8px; }
.member-list li { padding: 2px 0; break-inside: avoid; }

.sources { font-size: 0.92rem; }
.source-list { list-style: none; display: grid; gap: 8px; margin-bottom: 8px; }
.source-note { display: block; overflow-wrap: anywhere; }
.source-for { display: block; color: var(--muted-foreground); font-size: var(--text-secondary); }
.source-list li { overflow-wrap: anywhere; }

.ballot-day { margin-top: var(--space-4); }
.ballot-day:first-child { margin-top: 0; }
.ballot-day h3 { margin-bottom: 8px; }
/* Elections page: a day's votes grouped by government (ticket 359). */
.day-count { margin: -4px 0 6px; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.calendar-link .day-count { margin: 0; }
details.vote-group > summary { cursor: pointer; list-style: none; position: relative; padding: 2px 0 2px 26px; min-height: 44px; border-radius: 8px; }
details.vote-group > summary::-webkit-details-marker { display: none; }
details.vote-group > summary::before {
  content: '+'; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; line-height: 16px; text-align: center;
  border: 1px solid var(--border); border-radius: 999px; color: var(--primary-text); font-weight: 600; font-size: 0.85rem;
}
details.vote-group[open] > summary::before { content: '\2212'; }
details.vote-group > summary:hover .strong { color: var(--primary-text); }
details.vote-group > ul { margin: 8px 0 6px 26px; }
details.vote-group > .group-link { margin: 6px 0 0 26px; font-size: 0.93rem; }
details.vote-group + details.vote-group { margin-top: 6px; }
.ballot { list-style: none; display: grid; gap: 10px; }
.ballot-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: color-mix(in srgb, var(--elevated) 50%, transparent); }
.ballot-head { display: grid; gap: 2px; }
.ballot-office { font-weight: 600; }
.candidates { list-style: none; display: grid; gap: 4px; margin-top: 8px; }
.your-place { font-size: 1.15rem; margin-bottom: 4px; }

/* ═══ Feedback and decisions ═══ */
.filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 6px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button {
  min-height: 40px; padding: 7px 16px; border-radius: 999px; cursor: pointer; font-weight: 500;
  background: transparent; color: var(--muted-foreground); border: 1px solid var(--border);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.tabs button:hover { color: var(--foreground); background: var(--elevated); }
.tabs button:active { transform: scale(0.97); }
.tabs button[aria-pressed="true"] {
  background: var(--primary-soft); color: var(--primary-text);
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
}
.from { display: flex; align-items: center; gap: 8px; color: var(--muted-foreground); font-size: 0.92rem; max-width: 100%; }
.from select { min-width: 0; max-width: 100%; }
.from select, .report-form select, dialog select {
  font: inherit; min-height: 40px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--elevated); color: var(--foreground);
}
.from-note { font-size: 0.875rem; margin: 6px 0 14px; }
.status { color: var(--muted-foreground); }
.tickets { list-style: none; display: grid; gap: 12px; }
.ticket, .decision {
  background: color-mix(in srgb, var(--card) 80%, transparent); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-soft);
}
.ticket { padding: 16px 18px; }
.ticket.highlight { border-color: var(--primary); box-shadow: 0 0 12px -2px var(--primary); }
.ticket-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--muted-foreground); font-size: var(--text-secondary); }
.ticket-message { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.resolution { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: var(--elevated); font-size: 0.92rem; overflow-wrap: anywhere; }
.pill { margin-left: auto; font-weight: 600; font-size: 0.75rem; padding: 2px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-text); }
.pill-blocked { background: var(--soon-soft); color: var(--soon); }
.pill-resolved { background: var(--ok-soft); color: var(--ok); }
.pill-wont_fix { background: transparent; border: 1px solid var(--border); color: var(--muted-foreground); }

.decisions { display: grid; gap: 16px; margin-top: 14px; }
.decision { padding: 20px; }
.decision > h2 { margin-top: 8px; }
.decision .context { margin: 8px 0 0; white-space: pre-wrap; }
.options { list-style: none; margin: 14px 0 0; display: grid; gap: 10px; }
.option { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.option-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.option-head .pill { margin-left: 0; }
.option .votes { margin-left: auto; color: var(--muted-foreground); font-size: var(--text-secondary); font-variant-numeric: tabular-nums; }
.option p { margin: 4px 0 8px; color: var(--muted-foreground); font-size: 0.92rem; }
.bar { height: 6px; border-radius: 3px; background: var(--muted); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--primary); border-radius: 3px; box-shadow: 0 0 8px var(--primary); }
.responses { margin-top: 14px; }
.responses > summary { cursor: pointer; font-weight: 600; }
.responses ol { list-style: none; margin-top: 8px; display: grid; gap: 10px; }
.responses li { border-left: 2px solid var(--border); padding-left: 10px; }
.decision > .none { margin-top: 14px; color: var(--muted-foreground); }
.respond { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.respond h3 { margin-bottom: 10px; }
.respond fieldset { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.respond legend { font-weight: 500; margin-bottom: 4px; padding: 0; }
.respond label, .report-form label, dialog label { display: flex; flex-wrap: wrap; gap: 6px 4px; margin-bottom: 14px; font-weight: 500; }
:is(.respond, .report-form, dialog) label > :is(input, textarea, select) { flex: 1 1 100%; min-width: 0; }
.respond label.radio { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; min-height: 32px; }
.respond textarea, .respond input[type="text"], .report-form textarea, .report-form input[type="text"], .report-form input[type="password"], dialog textarea, dialog input {
  font: inherit; font-weight: 400; padding: 10px 12px; color: var(--foreground);
  border: 1px solid var(--border); border-radius: 10px; background: var(--elevated);
}
:is(.respond, .report-form, dialog) :is(textarea, input)::placeholder { color: var(--muted-foreground); }
textarea { resize: vertical; }
:is(.respond, .report-form, dialog) :is(textarea, input, select):focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent);
}
.optional { color: var(--muted-foreground); font-weight: 400; }
.about { background: var(--primary-soft); color: var(--foreground); border-radius: 10px; padding: 8px 12px; font-size: 0.92rem; margin: 0 0 12px; overflow-wrap: anywhere; }
.error { color: var(--danger-text); font-size: 0.92rem; margin: 0 0 12px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
.report-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.report-form .hint, dialog .hint { margin-top: 0; }

dialog {
  width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
  border: 1px solid var(--border); border-radius: 16px; padding: 24px;
  color: var(--foreground); background: var(--card); box-shadow: var(--shadow-modal);
}
dialog[open] { animation: fade-in-scale 0.25s ease-out both; }
dialog::backdrop { background: rgba(0, 0, 0, 0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog h2 { margin-bottom: 14px; }

/* ═══ Change log and demand ═══ */
.changelog-filters { justify-content: flex-start; gap: 12px 20px; margin-bottom: 4px; }
.changes { list-style: none; display: grid; gap: 14px; }
.change + .change { border-top: 1px solid var(--border); padding-top: 14px; }
.change-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--muted-foreground); font-size: var(--text-secondary); }
.change-meta code { font-size: var(--text-secondary); }
.change-title { font-weight: 600; margin: 6px 0 0; }
.change-detail { margin: 4px 0 0; color: var(--muted-foreground); white-space: pre-wrap; overflow-wrap: anywhere; }
.change-tickets { margin: 4px 0 0; font-size: 0.9rem; }
.pager { display: flex; gap: 20px; }
.wanted { padding-left: 22px; display: grid; gap: 10px; }
.demand-map { margin-top: 10px; }

.latest { margin: 8px 0 0; font-size: 0.93rem; }
.lead-fact { font-size: 1.05rem; margin: 12px 0; }
.not-on-ballot { margin: 10px 0 0; }
.checked-line { font-size: 0.875rem; margin: 16px 0 4px; }
.prose-page .block p { max-width: var(--measure); }
.calendar-link { margin: 4px 0 10px; font-size: 0.93rem; }
.prose-page .facts-list { margin-bottom: 14px; }
/* About: the mission and "How we're doing" (ticket 404). */
.mission-statement { font-family: var(--font-heading); font-weight: 600; font-size: 1.15rem; line-height: 1.45; letter-spacing: -0.01em; }
.measures { list-style: none; display: grid; gap: 10px; }
.measure {
  padding: 14px 16px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--elevated) 60%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.measure-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; }
.measure-name { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; margin: 0; flex: 1 1 16em; }
.measure-value { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--primary-text); }
.measure-value.pending {
  font-family: var(--font-sans); font-size: 0.75rem; font-weight: 600; line-height: 1.4; letter-spacing: 0;
  padding: 2px 10px; border-radius: 999px; color: var(--muted-foreground); border: 1px solid var(--border);
}
.prose-page .block .measure p { margin: 4px 0 0; }
.measure-detail { font-size: 0.93rem; font-variant-numeric: tabular-nums; }
.measure-how { font-size: 0.875rem; color: var(--muted-foreground); line-height: 1.5; }
.measure-asof { font-size: var(--text-secondary); color: var(--muted-foreground); }

/* ═══ Contact links on representatives (#65) ═══ */
.contact-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.contact-link {
  display: inline-block; min-height: 36px; padding: 6px 14px; line-height: 22px; box-sizing: border-box; white-space: nowrap;
  border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--foreground);
  font-size: 0.875rem; font-weight: 500; text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s, transform 0.15s;
}
.contact-link:hover { border-color: color-mix(in srgb, var(--primary) 45%, transparent); background: var(--primary-soft); color: var(--primary-text); }
.contact-link:active { transform: scale(0.97); }
.reps-hint { margin: 12px 0 0; font-size: 0.92rem; }

/* ═══ Who handles what (#66) ═══ */
.tasks-details > summary { cursor: pointer; padding: 8px 0; font-weight: 600; color: var(--primary-text); }
.task-list { margin: 6px 0 12px; display: grid; gap: 0; }
.task-row { padding: 10px 0; border-top: 1px solid var(--border); display: grid; grid-template-columns: 15em 1fr; gap: 4px 16px; }
.task-row dt { font-weight: 600; }
.task-row dd { margin: 0; grid-column: 2; }
.task-row dd .muted { display: block; font-size: 0.875rem; }
.task-site { font-size: 0.875rem; }
.task-note { display: block; font-size: var(--text-secondary); color: var(--foreground); margin-top: 2px; }

/* ═══ Governments you belong to (#67) ═══ */
.member-gov { padding: 12px 0; border-bottom: 1px solid var(--border); }
.member-gov:first-of-type { padding-top: 0; }
.member-gov h3 { margin-bottom: 6px; }
.member-gov h3:focus { outline: none; }
.member-gov .cards { margin-top: 8px; }
.member-gov button.link { min-height: 36px; font-size: 0.9rem; }
.member-add > summary { cursor: pointer; padding: 10px 0; font-weight: 600; color: var(--primary-text); }
.member-add label { display: block; font-weight: 500; margin: 8px 0 4px; }
.member-add input[type="search"] {
  width: 100%; max-width: 28em; min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--border); border-radius: 999px; font: inherit; background: var(--elevated); color: var(--foreground);
}
.member-add input[type="search"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.member-count { font-size: 0.875rem; margin: 6px 0; }
.member-matches { list-style: none; display: grid; gap: 4px; margin: 4px 0 10px; max-height: 18em; overflow-y: auto; }
.member-matches button {
  width: 100%; text-align: left; min-height: 44px; padding: 8px 14px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--foreground);
}
.member-matches button:hover { border-color: color-mix(in srgb, var(--primary) 45%, transparent); }

/* ═══ Share and print (#68) ═══ */
.share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 0; }
.share-status { font-size: 0.9rem; }

/* The printable card stays black on white in both themes. */
.gov-card-page { max-width: 760px; }
.card-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.gov-card {
  background: #fff; color: #000; border: 2px solid #0a0a0c; border-radius: var(--radius);
  padding: 28px; font-size: 1.125rem; line-height: 1.45; color-scheme: light;
}
.gov-card .muted { color: #333; }
.gov-card a { color: #000; }
.card-head { border-bottom: 2px solid #000; padding-bottom: 12px; margin-bottom: 8px; }
.card-head h1 { font-size: 2.1rem; }
.card-place { font-size: 1.3rem; font-weight: 600; margin: 6px 0 0; }
.card-gov { padding: 14px 0; border-bottom: 1px solid #999; break-inside: avoid; }
.card-gov h2 { font-size: 1.45rem; margin-bottom: 8px; }
.card-level { font-size: 0.95rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 2px; }
.card-people { list-style: none; display: grid; gap: 10px; margin-bottom: 8px; }
.card-person-name { font-weight: 700; font-size: 1.25rem; }
.card-role, .card-contact { display: block; }
.card-contact a { color: #000; }
.card-vote { margin: 6px 0 0; }
.card-treaty-list { list-style: none; display: grid; gap: 4px; }
.card-foot { display: flex; gap: 20px; align-items: center; padding-top: 18px; break-inside: avoid; }
.card-qr { width: 132px; flex: none; }
.card-qr svg { display: block; width: 100%; height: auto; }
.card-url { font-size: 1rem; word-break: break-all; }
.card-small { font-size: 0.95rem; margin-top: 8px; }

/* One quiet note when facts are left out (#103) */
.still-adding { font-size: 0.9rem; margin: 10px 0 0; }

/* ═══ Photos (tickets 105, 107) ═══ */
img.avatar { display: block; background: var(--elevated); }
.avatar.small { width: 32px; height: 32px; font-size: 0.75rem; }
/* A seat recorded as vacant (#134, #166). */
.avatar.vacant { background: transparent; border: 1.5px dashed var(--border); color: var(--muted-foreground); }
.contest-note { font-size: 0.875rem; margin: 6px 0 0; }
.person-row > span { min-width: 0; }
.holders .person-row, .seat-holders .person-row, .seats-table .person-row, .candidates li { display: flex; gap: 10px; align-items: center; }
.seats-table .person-row { align-items: center; }
.seats-table .person-row + .person-row { margin-top: 6px; }
.seat-holders { display: grid; gap: 6px; margin-top: 6px; }
.candidates { gap: 8px; }
.person-photo { margin: 0; flex: none; width: 120px; }
.person-photo img {
  display: block; width: 120px; height: 150px; object-fit: cover; object-position: center top;
  border-radius: var(--radius); background: var(--elevated); border: 1px solid var(--border); box-shadow: var(--feed-card-shadow);
}
.person-photo { position: relative; }
.person-photo figcaption { font-size: 0.75rem; color: var(--muted-foreground); margin-top: var(--space-2); line-height: 1.35; max-width: 100%; }
.person-photo figcaption a { color: var(--muted-foreground); }
/* Short credit: at most two lines, the full name in the tooltip and the licence panel (ticket 484). */
.photo-credit {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  overflow-wrap: break-word; hyphens: auto;
}
.photo-licence-short { display: block; margin-top: 2px; }
details.photo-licence { margin-top: 2px; }
details.photo-licence > summary {
  display: inline-flex; align-items: center; gap: 4px; min-height: 24px; cursor: pointer; list-style: none; user-select: none;
  color: var(--muted-foreground); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px;
  transition: color 0.15s;
}
details.photo-licence > summary::-webkit-details-marker { display: none; }
details.photo-licence > summary::after {
  content: ""; flex: none; width: 5px; height: 5px; margin: 0 2px 3px 3px; border: solid currentColor; border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
details.photo-licence[open] > summary::after { transform: rotate(-135deg); margin: 3px 2px 0 3px; }
details.photo-licence > summary:hover, details.photo-licence[open] > summary { color: var(--foreground); }
/* The licence opens as a small panel over the page, wider than the photo, instead of a tall column. */
.photo-licence-panel {
  position: absolute; left: 0; top: calc(100% + 4px); z-index: 20; width: min(22rem, calc(100vw - 32px));
  padding: var(--space-3); border-radius: var(--radius); font-size: var(--text-secondary); line-height: 1.5; color: var(--muted-foreground);
  background: var(--elevated); border: 1px solid var(--border); box-shadow: var(--shadow-soft, var(--feed-card-shadow));
  overflow-wrap: anywhere;
}
.photo-licence-panel p { margin: 0; }
.photo-licence-panel p + p { margin-top: 6px; }
.photo-licence-credit { color: var(--foreground); font-weight: 500; }

/* ═══ Names in other languages (ticket 112) ═══ */
.other-names { list-style: none; margin: 6px 0 0; display: grid; gap: 2px; font-size: 0.98rem; }

/* ═══ Contact points (ticket 109) ═══ */
.contact-points { list-style: none; display: grid; gap: 14px; margin-top: 4px; }
.contact-point + .contact-point { border-top: 1px solid var(--border); padding-top: 14px; }
.contact-point .address { margin: 2px 0 6px; }
.contact-point .contact { gap: 4px; }
.contact .muted { display: inline-block; min-width: 5.5em; }

/* ═══ Record this term and said, then did (ticket 106) ═══ */
.record-term { margin: 14px 0 8px; font-size: 1rem; }
.tiles { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 8px; }
.tile { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: color-mix(in srgb, var(--elevated) 50%, transparent); }
.tile-big { display: block; font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile-label { display: block; font-weight: 500; }
.tile-sub { display: block; color: var(--muted-foreground); font-size: var(--text-secondary); margin-top: var(--space-1); }
.said-did-list { list-style: none; display: grid; gap: 16px; }
.said-did { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.said-did:first-child { border-top: 0; padding-top: 0; }
.said-did .link-note, .said-did > .report { grid-column: 1 / -1; margin: 0; font-size: var(--text-secondary); }
.said-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-foreground); margin-bottom: 4px; }
.said blockquote { margin: 0 0 6px; padding-left: 12px; border-left: 3px solid var(--primary); }

/* ═══ How to vote (ticket 63) ═══ */
.vote-topic + .vote-topic { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.vote-topic h3 { margin-bottom: 6px; }
.vote-items { list-style: none; display: grid; gap: 10px; }
.vote-items p { margin: 0 0 4px; }
.vote-when { font-weight: 500; }
.how-link { margin: 8px 0 0; font-size: 0.93rem; }

/* ═══ Motion: the answer's cards fade in with a stagger (under 0.7 s);
   pages themselves paint at once. Reduced motion turns it all off.
   Automated contrast checks should wait for document.getAnimations() to
   finish, or run with reduced motion. ═══ */
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in-scale { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
.cards > li, .results > .block { animation: fade-in 0.3s ease-out both; }
.cards > li:nth-child(2) { animation-delay: 40ms; }
.cards > li:nth-child(3) { animation-delay: 80ms; }
.cards > li:nth-child(4) { animation-delay: 120ms; }
.cards > li:nth-child(5) { animation-delay: 160ms; }
.cards > li:nth-child(6) { animation-delay: 200ms; }
.cards > li:nth-child(7) { animation-delay: 240ms; }
.cards > li:nth-child(8) { animation-delay: 280ms; }
.cards > li:nth-child(9) { animation-delay: 320ms; }
.cards > li:nth-child(n+10) { animation-delay: 360ms; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
  .button:hover:not(:disabled), .button:active:not(:disabled) { transform: none; }
}

/* ═══ Phones ═══ */
@media (max-width: 759px) {
  .tabbar {
    display: block; position: fixed; z-index: 1600;
    left: 16px; right: 16px; bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }
  .tabbar-glass {
    display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px; border-radius: 30px;
    /* A little more opaque than --glass-bg so labels stay AA over white content. */
    background: color-mix(in srgb, var(--background) 86%, transparent); -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border); box-shadow: var(--feed-card-shadow);
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 52px; padding: 6px 0; border-radius: 24px;
    color: var(--muted-foreground); text-decoration: none; font-size: 11px; font-weight: 400;
    transition: background-color 0.25s var(--ease-out), color 0.2s, box-shadow 0.25s, transform 0.15s;
  }
  .tab:active { transform: scale(0.97); }
  .tab[aria-current="page"] {
    color: var(--primary-text); font-weight: 500;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    box-shadow: 0 0 12px -2px color-mix(in srgb, var(--primary) 70%, transparent);
  }
  .tab[aria-current="page"] .icon { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--primary) 70%, transparent)); }
  .frame { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .feedback-fab { display: none; }
  .footer { padding-bottom: 24px; }
  .home-page.no-place .footer { display: none; }

  .no-place .home { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .no-place .picker { grid-column: 1; grid-row: 1; border-right: 0; padding: 24px 16px 22px; }
  .no-place .side { grid-column: 1; grid-row: 2; height: 48vh; min-height: 280px; position: relative; top: 0; }
  .no-place .results { grid-column: 1; grid-row: 3; border-right: 0; }
  .bootmark { font-size: 1.35rem; margin-bottom: 14px; }
  .eyebrow { margin-bottom: 14px; }

  .has-place .home { grid-template-columns: minmax(0, 1fr); grid-template-areas: "picker" "results" "side"; padding: 18px 16px 24px; }
  .has-place .map-wrap { height: 180px; }
  .has-place.map-expanded .map-wrap { position: fixed; inset: var(--topbar) 0 0 0; margin: 0; height: auto; z-index: 1700; }
  .answer-head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "chip" "title" "sub"; justify-items: start; }
  .chip { max-width: 100%; }
  .banner-vote { grid-template-columns: auto minmax(0, 1fr); }
  .banner-count { font-size: 1.3rem; min-width: 4.2rem; }
  .banner-button { grid-column: 1 / -1; width: 100%; }
  .page { padding: var(--space-3) var(--space-3) var(--space-5); }
  .block { padding: var(--space-3); }
  .card { padding: var(--space-3); }
  .page-head { margin-bottom: var(--space-4); }
  .facts-list div { grid-template-columns: 1fr; gap: 0; }
  .person-head { align-items: flex-start; }
  .avatar.large { width: 56px; height: 56px; font-size: 1.2rem; }
  .filters { flex-direction: column; align-items: flex-start; }
  .task-row { grid-template-columns: 1fr; }
  .task-row dd { grid-column: 1; }
  .gov-card { padding: 18px 16px; }
  .card-head h1 { font-size: 1.7rem; }
  .card-foot { flex-direction: column; align-items: flex-start; }
  .person-photo, .person-photo img { width: 88px; }
  .person-photo img { height: 110px; }
  .said-did { grid-template-columns: 1fr; }
}
/* Very small screens (320 px, or 400% zoom): no sideways scroll (#239). */
@media (max-width: 359px) {
  .topbar { gap: 6px; padding: 0 12px; }
  .topbar .preview-chip { padding: 2px 8px; }
  .search { flex-wrap: wrap; }
  .search input, .search .button { flex: 1 1 100%; }
  .tabbar { left: 8px; right: 8px; }
}

@media print {
  @page { margin: 14mm; }
  :root { --rail: 0px; --topbar: 0px; }
  body { background: #fff; color: #000; font-size: 14pt; }
  .topbar, .rail, .tabbar, .footer, .feedback-fab, dialog, .no-print, .skip,
  .map-wrap, .picker, .report, .share-actions, .report-line, .crumbs { display: none !important; }
  .frame { margin: 0; padding: 0; }
  main { padding: 0 !important; }
  .page { padding: 0; max-width: none; }
  .block { border: 0; padding: 0; margin: 0 0 14pt; box-shadow: none; background: none; }
  a { color: #000; text-decoration: none; }
  .gov-card { border: 0; padding: 0; font-size: 14pt; }
  .card-head h1 { font-size: 26pt; }
  .card-gov h2 { font-size: 18pt; }
  .card-person-name { font-size: 16pt; }
  .card-qr { width: 30mm; }
}

/* Referendum questions in ballot order (ticket 315) */
.questions { list-style: none; display: grid; gap: 10px; margin-top: 10px; padding: 0; }
.questions > li { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; background: color-mix(in srgb, var(--elevated) 50%, transparent); }
.questions .sub { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); margin-bottom: 4px; }
.questions ul { margin: 6px 0 0 18px; }

/* Not-elected bodies (the Crown, courts) sit last and collapsed (ticket 21). */
.not-elected { margin-top: 20px; }
.not-elected > summary { cursor: pointer; list-style: none; padding: 10px 0; min-height: 44px; display: flex; align-items: center; }
.not-elected > summary::-webkit-details-marker { display: none; }
.not-elected > summary .section-label { margin: 0; }
.not-elected > summary::after { content: '+'; margin-left: auto; color: var(--muted-foreground); font-size: 1.2rem; }
.not-elected[open] > summary::after { content: '\2212'; }
.change-title a { color: inherit; text-decoration: none; }
.change-title a:hover { color: var(--primary); text-decoration: underline; }
.change-view { margin: 4px 0 0; font-size: 0.9rem; }

/* Anchors land below the sticky top bar (ticket 355); how to vote block (354); folded trustees (357) */
html { scroll-padding-top: calc(var(--topbar) + 16px); }
.how-block { margin: 8px 0 12px; padding: 10px 14px; border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: var(--radius); background: color-mix(in srgb, var(--elevated) 50%, transparent); }
.how-block p { margin: 2px 0; }
.how-block .banner-sub { margin-top: 2px; }
.more-reps { margin-top: 4px; }
.more-reps > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--primary-text); font-weight: 600; }
.banner .button.secondary { background: transparent; border: 1px solid currentColor; }

/* Topic pages: who holds which powers over a topic (ticket 406). */
.topic-cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); padding: 0; }
.topic-cards .card { height: 100%; }
.topic-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 8px; }
.topic-chips .chip { max-width: 100%; text-decoration: none; min-height: 36px; padding: 6px 14px; }
.topic-place { margin: 4px 0 8px; }
.topic-place p { margin: 0; }
.topic-place .chip { max-width: 100%; text-decoration: none; }
.topic-explain { font-size: 0.9rem; margin: 8px 0 4px; }
.topic-level > h2.section-label { margin: 0 0 12px; }
.topic-level { animation: fade-in 0.3s ease-out both; }
.topic-authority + .topic-authority { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.topic-authority h3 { margin: 0; font-family: var(--font-heading); font-weight: 600; letter-spacing: -0.01em; }
.topic-authority h3 a { color: var(--foreground); text-decoration: none; }
.topic-authority h3 a:hover { color: var(--primary-text); text-decoration: underline; }
.topic-authority .power-list { margin-top: 12px; padding: 0; }
.topic-related { display: inline-block; margin-top: 4px; }
.topic-quiet > h2.section-label { margin: 0 0 8px; }
.quiet-list { list-style: none; padding: 0; display: grid; gap: 6px; font-size: 0.92rem; }
.topic-picker .page-actions { margin-top: 0; }
.task-row dt a { color: var(--foreground); }
.task-row dt a:hover { color: var(--primary-text); }
.task-row dt a.task-topic-link { display: block; font-size: 0.85rem; font-weight: 500; margin-top: 2px; color: var(--primary-text); }
/* Changes to who holds these powers (power_event, ticket 441): dated
   entries, newest first, each with who made it, whom it applies to and the
   law's official text. */
.topic-events > h2.section-label { margin: 0 0 8px; }
.topic-events { animation: fade-in 0.3s ease-out both; }
.event-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 16px; }
.event + .event { border-top: 1px solid var(--border); padding-top: 16px; }
.topic-events .event h3 { margin: 4px 0 6px; font-family: var(--font-heading); font-weight: 600; letter-spacing: -0.01em; font-size: 1.05rem; line-height: 1.35; }
.event > p { margin: 0 0 8px; }
.event-date { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted-foreground); font-size: var(--text-secondary); font-variant-numeric: tabular-nums; margin: 0 !important; }
.event-facts { display: grid; gap: 4px; margin: 0 0 4px; font-size: 0.92rem; }
.event-facts > div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 8px; }
.event-facts dt { color: var(--muted-foreground); font-weight: 500; }
.event-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .event-facts > div { grid-template-columns: 1fr; gap: 0; } .event-facts > div + div { margin-top: 4px; } }
@media (prefers-reduced-motion: reduce) { .topic-level, .topic-events { animation: none; } }

/* "Your representatives" beside the map (ticket 409): compact rows grouped
   by body. In the sticky right column it scrolls on its own when long. */
.reps-panel {
  background: color-mix(in srgb, var(--card) 80%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: 16px;
}
[data-theme="dark"] .reps-panel { border-color: var(--border); }
.side-reps .reps-panel { overflow-y: auto; overscroll-behavior: contain; min-height: 0; scrollbar-width: thin; }
.reps-slot .reps-panel { margin: 14px 0; animation: fade-in 0.3s ease-out both; }
.reps-slot:empty { display: none; }
.reps-title { font-size: 1.05rem; margin: 0 0 4px; }
.reps-group + .reps-group { margin-top: 14px; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.reps-body { font-family: var(--font-sans); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-foreground); margin: 10px 0 2px; line-height: 1.4; }
.reps-body a { color: inherit; text-decoration: none; }
.reps-body a:hover { color: var(--primary-text); text-decoration: underline; }
.people.compact { gap: 0; }
.people.compact > .person-row { padding: 8px 0; gap: 10px; }
.people.compact .person-name { font-size: 0.92rem; }
.people.compact .sub { font-size: var(--text-secondary); }
.people.compact .contact-links { margin-top: 6px; gap: 4px; }
.people.compact .contact-link { min-height: 30px; padding: 3px 10px; font-size: 0.8rem; }
.reps-panel .more-reps > summary { min-height: 36px; font-size: 0.88rem; }
.reps-panel .reps-hint { font-size: var(--text-secondary); margin: var(--space-3) 0 0; }
.avatar.small.vacant { font-size: 0.9rem; }

/* Owner sign-in (ticket 480). */
.owner-login { margin-bottom: 20px; }

/* About: how it works, with a status chip per part, and measure targets
   (tickets 474, 479). */
.how-list { list-style: none; display: grid; gap: 10px; max-width: var(--measure); }
.how-list > li {
  padding: 14px 16px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--elevated) 60%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.how-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.how-head h3 { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; margin: 0; }
.prose-page .block .how-list p { margin: 4px 0 0; }
.measure-figure { white-space: nowrap; }
.measure-target { font-size: 0.93rem; font-weight: 500; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.about-links li { display: grid; gap: 2px; }
.about-links a { font-weight: 600; }
.about-links .muted { font-size: 0.93rem; }

/* A seat's list or reservation under its name in an office's seat table (ticket 490). */
.seats-table th .seat-note { font-weight: 400; }
