/*
 * CIVCNCT / Bürgerpilot static sites.
 * The CSP allows styles only from this file: no style attributes, no <style> elements.
 * Colour tokens: platform/docs/brand/05-identity.md §5 (all pairs WCAG 2.2 AA).
 * Fonts: system stack only. No web fonts, no third-party requests.
 */

:root {
  color-scheme: light dark;
  --ink: #0f172a;
  --muted: #475569;
  --teal: #0b6b63;
  --indigo: #4f46e5;
  --page: #f7f8fb;
  --surface: #ffffff;
  --surface2: #eef1f6;
  --line: #dde3ec;
  --line-strong: #748197;
  --teal-soft: #e0f1ee;
  --indigo-soft: #eef0ff;
  --on-teal: #ffffff;
  --warn: #8a5300;
  --warn-soft: #fbefd9;
  --shadow: rgb(15 23 42 / 0.12);
  --todo-bg: #fff3c4;
  --todo-ink: #5c3b00;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1f5f9;
    --muted: #a3b0c2;
    --teal: #5ccfc1;
    --indigo: #a5b4fc;
    --page: #0b1020;
    --surface: #131b2e;
    --surface2: #182238;
    --line: #243049;
    --line-strong: #6b7a96;
    --teal-soft: #12302f;
    --indigo-soft: #1f2350;
    --on-teal: #04201d;
    --warn: #f2b54d;
    --warn-soft: #2f2412;
    --shadow: rgb(0 0 0 / 0.35);
    --todo-bg: #3d2f00;
    --todo-ink: #ffe08a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
}

.wrap {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1rem;
}

a {
  color: var(--indigo);
  font-weight: 600;
  text-decoration: none;
}

/* A decorative chevron distinguishes links inside prose without changing their accessible name. */
:where(p, dd, dt, figcaption, li) > a:where(:not([class]))::after {
  content: "";
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-inline: 0.16em 0.12em;
  border-block-start: 1.5px solid currentColor;
  border-inline-end: 1.5px solid currentColor;
  transform: translateY(-0.08em) rotate(45deg);
}

:where(p, dd, dt, figcaption, li) > a:where(:not([class])):hover {
  background: var(--indigo-soft);
}

:where(nav, .picker) li > a::after {
  content: none;
}

:focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 2px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  hyphens: auto;
}

h1 {
  font-size: clamp(1.9rem, 7vw, 2.9rem);
  font-weight: 800;
  margin: 0.4rem 0 1rem;
}

h2 {
  font-size: 1.4rem;
  font-weight: 750;
  margin: 2.5rem 0 0.75rem;
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

p,
ul,
dl {
  margin: 0 0 1rem;
}

/* Skip link: visible only on keyboard focus. */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--surface);
  color: var(--ink);
  padding: 0.5rem 1rem;
  border: 2px solid var(--indigo);
  border-radius: 8px;
}

/* Header and brand lockup */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
}

.brand .symbol {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
}

.brand .wordmark {
  height: 1.9rem;
  width: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-by {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.header-nav a {
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.95rem;
}

.header-nav a:hover,
.header-nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--indigo-soft);
}

/* SVG parts follow the colour scheme. Fill attributes in the markup are the fallback. */
.s-teal {
  fill: var(--teal);
}

.s-indigo {
  fill: var(--indigo);
}

.s-ink {
  fill: var(--ink);
}

/* Main content */
main {
  padding-bottom: 1rem;
}

.hero {
  padding: 2.25rem 0 0.5rem;
}

.search-home h1 {
  hyphens: manual;
  text-wrap: balance;
}

/* One government question is the primary action. The terminal is a selectable example. */
body:has(.gateway-home) .wrap { max-width: 74rem; padding-inline: clamp(1rem, 4vw, 3rem); }
.gateway-home .search-home {
  padding-block: clamp(2rem, 5vw, 4.8rem) 0;
  display: grid;
  gap: 1rem;
  grid-template-areas: "intro" "query" "terminal";
}
.gateway-intro { grid-area: intro; }
.gateway-query { grid-area: query; min-width: 0; }
.gateway-home .search-home h1 {
  max-width: 18ch;
  margin: 0 0 .7rem;
  font-size: clamp(2.1rem, 5vw, 3.9rem);
  line-height: 1.04;
  letter-spacing: -.055em;
}
.gateway-home h1 em { color: var(--teal); font-style: normal; }
.gateway-home:lang(ja) h1 { max-width: 14em; line-height: 1.24; letter-spacing: -.03em; }
.gateway-home .lead { max-width: 49ch; margin: 0; font-size: 1.05rem; line-height: 1.5; color: var(--muted); }
.gateway-home .catalogue-search {
  margin: 0;
  padding: .8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 3px 16px var(--shadow);
}
.gateway-home .query-modes { margin-bottom: .55rem; }
.gateway-home .catalogue-search .search-bar { align-items: stretch; }
.gateway-home .gateway-actions { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .35rem; font-size: .88rem; }
.gateway-actions a { padding: .45rem 0; }
.gateway-actions a:hover { color: var(--teal); }
.gateway-terminal {
  grid-area: terminal;
  align-self: center;
  min-width: 0;
  margin: .25rem 0 0;
  color: #e2f6f3;
  background: linear-gradient(140deg, #142c34, #0d1a25 75%);
  border: 1px solid #35545c;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 .75rem 2rem -.9rem #102e4350;
}
.gateway-terminal figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .72rem 1rem;
  border-bottom: 1px solid #385058;
  font: 600 .84rem/1.4 var(--font);
  color: #edf8f7;
}
.gateway-terminal figcaption b { color: #99babd; font: .75rem var(--mono); }
.gateway-terminal pre {
  margin: 0;
  padding: 1.15rem 1rem;
  background: transparent;
  border: 0;
  color: inherit;
  font: .81rem/1.65 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.gateway-terminal code { font: inherit; background: transparent; color: inherit; padding: 0; }
.gateway-terminal code span { display: inline; }
.gateway-terminal code span:first-child { color: #88ddcb; }
.terminal-result { padding: .8rem 1rem; display: grid; gap: .2rem; border-top: 1px solid #385058; }
.terminal-result samp { color: #a3f6cf; font: 600 .88rem/1.4 var(--mono); }
.terminal-result samp::before { content: "› "; }
.terminal-result a { width: fit-content; color: #d5e8ec; font-size: .83rem; }
.terminal-result a:hover { color: white; }
@media (min-width: 56rem) {
  .gateway-home .search-home {
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
    grid-template-areas: "intro terminal" "query terminal";
    column-gap: clamp(2rem, 5vw, 4.5rem);
  }
  .gateway-terminal { margin: 0; }
}
@keyframes terminal-type {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0); }
}
@keyframes terminal-answer { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) and (min-width: 30rem) {
  .gateway-terminal code span { display: inline-block; max-width: 100%; vertical-align: top; animation: terminal-type .4s steps(18,end) backwards; }
  .gateway-terminal code span:nth-child(2) { animation-delay: .35s; }
  .gateway-terminal code span:nth-child(3) { animation-delay: .7s; }
  .gateway-terminal code span:nth-child(4) { animation-delay: 1.05s; }
  .gateway-terminal code span:nth-child(5) { animation-delay: 1.4s; }
  .terminal-result { animation: terminal-answer .3s 1.85s backwards; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.catalogue-search .query-modes {
  display: inline-flex;
  gap: 0.2rem;
  margin: 0 0 0.75rem;
  padding: 0.2rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 0.75rem;
}

.catalogue-search .mode-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.3rem 0.8rem;
  margin: 0;
  border-radius: 0.5rem;
  cursor: pointer;
}

.mode-option input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--teal);
}

.mode-option:has(input:checked) {
  color: var(--on-teal);
  background: var(--teal);
}

.mode-option:has(input:focus-visible) {
  outline: 3px solid var(--indigo);
  outline-offset: 2px;
}

.catalogue-search .search-bar {
  align-items: end;
}

.catalogue-search textarea,
.catalogue-search select {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

.catalogue-search textarea {
  flex: 1 1 12rem;
  min-width: 0;
  line-height: 1.4;
  resize: vertical;
}

.catalogue-search .chat-country {
  margin-bottom: 0.65rem;
}

.chat-country select {
  max-width: 100%;
}

.catalogue-search .mode-hint {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.catalogue-search .chat-reply {
  display: block;
  width: 100%;
  height: 5rem;
  min-height: 5rem;
  max-height: 75vh;
  margin-top: 0.75rem;
  resize: vertical;
  overflow: auto;
  color-scheme: light dark;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 0.5rem;
}

.catalogue-search .chat-active {
  height: clamp(18rem, 52vh, 32rem);
}

.chat-waiting {
  padding: 0.75rem 1rem;
  color: var(--muted);
  background: var(--surface);
}

.chat-waiting p {
  margin: 0;
}

.catalogue-search:has(#mode-search:checked) :is(.chat-submit, .chat-hint, .chat-country, .chat-reply),
.catalogue-search:has(#mode-chat:checked) :is(.search-submit, .search-hint) {
  display: none;
}

@media (min-width: 32rem) {
  .catalogue-search .chat-country {
    display: flex;
    align-items: center;
    gap: 0.65rem;
  }

  .catalogue-search .chat-country label {
    margin: 0;
  }
}

.gateway-home .search-examples a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
}

.gateway-evidence,
.gateway-directory,
.gateway-guide,
.gateway-contact {
  margin-block-start: clamp(1.75rem, 4vw, 2.75rem);
  padding-block-start: 1.2rem;
  border-block-start: 1px solid var(--line);
}

.gateway-home :is(.coverage-snapshot, .gateway-directory, .gateway-guide, .gateway-contact) h2 {
  margin-block-start: 0;
}

.gateway-evidence .facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-block: 0.85rem 0.5rem;
}

.gateway-evidence .facts > li {
  padding: clamp(0.65rem, 2vw, 1rem);
}

.gateway-evidence .facts strong {
  font-size: clamp(1.55rem, 4vw, 2rem);
  font-variant-numeric: tabular-nums;
}

.gateway-directory .country-apps {
  margin-block-end: 0.65rem;
}

.gateway-more-countries > summary {
  width: fit-content;
  padding: 0.65rem 0.25rem;
  color: var(--indigo);
  font-weight: 650;
  cursor: pointer;
}

.gateway-more-countries > summary:hover {
  background: var(--indigo-soft);
  border-radius: 4px;
}

@media (min-width: 40rem) {
  .gateway-evidence .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .gateway-directory .country-arrow {
    transition: transform 140ms ease-out;
  }

  .gateway-directory .country-app:is(:hover, :focus-visible) .country-arrow {
    transform: translateX(0.15rem);
  }
}

.badge {
  display: inline-block;
  margin: 0;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--indigo-soft);
  color: var(--indigo);
  font-size: 0.85rem;
  font-weight: 700;
}

.tagline {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.5em;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--teal);
}

.lead {
  font-size: 1.15rem;
}

.note {
  border-left: 4px solid var(--indigo);
  background: var(--surface2);
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
}

.note > p:last-child,
.callout > p:last-child {
  margin-bottom: 0;
}

.catalogue-search {
  padding: 1.2rem;
  margin: 1.3rem 0 .65rem;
  color: var(--ink);
  background: var(--teal-soft);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
}
.catalogue-search :is(.question-label, .chat-country label) { display: block; margin-bottom: .45rem; font-weight: 700; }
.search-bar { display: flex; flex-wrap: wrap; gap: .5rem; }
.search-bar input, .search-bar button {
  padding: .7rem .9rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}
.search-bar input { flex: 1 1 12rem; min-width: 0; }
.search-bar button { color: var(--on-teal); background: var(--teal); border-color: var(--teal); cursor: pointer; font-weight: 700; }
.search-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.search-examples a {
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9rem;
}

.search-examples a:hover {
  border-color: var(--indigo);
  background: var(--indigo-soft);
}

/* Prominent link to the web app ("Bürgerpilot starten"). The app runs on its own host. */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 0.25rem 0 1.25rem;
}

.cta {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  background: var(--teal);
  color: var(--on-teal);
  font-size: 1.1rem;
  font-weight: 750;
  text-decoration: none;
}

.cta:hover {
  box-shadow: 0 0 0 3px var(--line-strong);
}

/* Second link in the row (civcnct.com: "API and MCP"). Outline, so the web app link stays the main one. */
.cta-alt {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border: 2px solid var(--indigo);
  border-radius: 999px;
  color: var(--indigo);
  font-weight: 700;
  text-decoration: none;
}

.cta-alt:hover {
  background: var(--indigo-soft);
}

/*
 * civcnct.com API and MCP (wave 6): key figures, small print with the basis of each number, endpoint lists,
 * code snippets (wrapped, never a sideways scroll at 320 px) and the country list of the developer page.
 */
.subhead {
  margin-top: -0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--teal);
}

.endpoint-line {
  color: var(--muted);
  font-size: 0.95rem;
}

.facts {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0.4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.facts > li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.facts strong {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--teal);
}

.facts span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
  overflow-wrap: break-word;
  hyphens: auto;
}

.fineprint {
  color: var(--muted);
  font-size: 0.9rem;
}

section.fineprint h2 {
  font-size: 1.1rem;
}

section.fineprint ul {
  padding-left: 1.2rem;
}

section.fineprint li {
  margin-bottom: 0.4rem;
}

pre {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

pre code {
  font-size: inherit;
}

.endpoints dt {
  font-weight: 650;
  overflow-wrap: anywhere;
}

.endpoints dd {
  margin: 0 0 0.75rem;
}

.countries {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.countries > li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.countries .country {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.countries .code {
  flex: none;
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
  background: var(--indigo-soft);
  color: var(--indigo);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
}

.planned {
  color: var(--muted);
}

/* The entire country row opens its assistant, including its flag and ISO code. */
.country-apps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 0.5rem;
}

.country-app {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  height: 100%;
  min-height: 2.85rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
}

.country-app:hover,
.picker > li > a:hover {
  border-color: var(--indigo);
  background: var(--indigo-soft);
}

.country-flag {
  flex: none;
  font-size: 1.25rem;
  line-height: 1;
}

.country-app .code {
  font-family: var(--mono);
  font-size: 0.83rem;
  color: var(--muted);
}

.country-name {
  font-weight: 650;
}

.country-arrow {
  margin-inline-start: auto;
  color: var(--indigo);
  font-size: 1.2rem;
  line-height: 1;
}

.coverage-snapshot h2 {
  margin: 1.5rem 0 0.25rem;
  font-size: 1.18rem;
}

.coverage-snapshot > p {
  margin: 0.25rem 0 0.6rem;
}

.activity-heading {
  display: flex;
  flex-direction: column;
}

.activity-scope {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.activity-panel {
  margin: 1rem 0;
  padding: 0.3rem 0.75rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
}

.activity-details summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.35rem 0.2rem;
  border-radius: 4px;
  list-style: none;
  cursor: pointer;
  font-weight: 700;
}

.activity-details summary::-webkit-details-marker { display: none; }

.activity-details summary:hover { background: var(--indigo-soft); }

.activity-toggle {
  margin-inline-start: auto;
  color: var(--indigo);
  text-align: end;
  font-size: 0.85rem;
}

.activity-details summary::after {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  margin-inline: 0.15rem 0.4rem;
  border-inline-end: 2px solid var(--indigo);
  border-block-end: 2px solid var(--indigo);
  transform: translateY(-0.12rem) rotate(45deg);
}

.activity-details[open] summary::after { transform: translateY(0.12rem) rotate(225deg); }

.activity-details p,
.activity-panel > p {
  margin: 0.3rem 0 0.6rem;
  font-size: 0.92rem;
}

.source-activity {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.45rem;
}

.source-activity p {
  position: relative;
  margin: 0;
  padding: 0.4rem 0.6rem 0.45rem 1.45rem;
  border-radius: 6px;
  background: var(--surface2);
  font-size: 0.9rem;
}

.activity-check::before,
.activity-dataset::before {
  content: "";
  position: absolute;
  inset-inline-start: 0.55rem;
  inset-block-start: 0.94rem;
  width: 0.42rem;
  height: 0.42rem;
}

.activity-check::before {
  border: 2px solid var(--teal);
  border-radius: 50%;
}

.activity-dataset::before {
  background: var(--indigo);
  transform: rotate(45deg);
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

.callout {
  background: var(--teal-soft);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.cards {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.cards > li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.cards > li p {
  margin: 0;
}

.checks {
  list-style: none;
  padding: 0;
}

.checks > li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.5rem;
}

.checks > li::before {
  content: "\2713";
  position: absolute;
  left: 0.2rem;
  top: 0;
  font-weight: 800;
  color: var(--teal);
}

/* Country and language pickers */
.picker {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

/* The card is the direct link of the item; a link in a .hint line stays a plain link. */
.picker > li > a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
}

.picker .code {
  flex: none;
  min-width: 2.6rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: var(--indigo-soft);
  color: var(--indigo);
  font-family: var(--mono);
  font-weight: 700;
  text-align: center;
}

.picker .label {
  display: flex;
  flex-direction: column;
}

.picker .label strong {
  font-size: 1.1rem;
}

.picker .label span {
  color: var(--muted);
  font-size: 0.95rem;
}

.picker .hint {
  margin: 0.4rem 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* "So funktioniert es" / "How it works": numbered cards. The numbers come from a counter. */
.steps {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  counter-reset: step;
}

.steps > li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.steps > li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.6rem;
  border-radius: 50%;
  background: var(--teal);
  color: var(--on-teal);
  font-weight: 800;
}

.steps > li p {
  margin: 0;
}

/*
 * Product preview: a static mock of the planned app, built from HTML and this file only.
 * Every frame shows the label "Beispiel". The mock holds no links, buttons or form controls,
 * so nothing in it looks clickable to the keyboard. tests/check_static.py checks both rules.
 */
.preview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0 0 1rem;
}

.preview figcaption {
  color: var(--muted);
  font-size: 0.95rem;
}

.mock {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 1px 2px var(--shadow), 0 12px 28px -14px var(--shadow);
  font-size: 0.92rem;
  line-height: 1.45;
  overflow-wrap: break-word;
  cursor: default;
}

.mock p,
.mock ul,
.mock dl {
  margin: 0;
}

.mock .icon {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
}

.mock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--line);
}

.mock-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.mock-brand .symbol {
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
}

.mock-label {
  flex: none;
  padding: 0.05rem 0.55rem;
  border: 1px dashed var(--indigo);
  border-radius: 999px;
  background: var(--indigo-soft);
  color: var(--indigo);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mock-body {
  display: grid;
  gap: 0.85rem;
  padding: 1rem 0.95rem 1.1rem;
}

.mock-title {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.mock-field {
  position: relative;
  min-height: 4.6rem;
  padding: 0.7rem 3.1rem 0.7rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
}

.mock-send {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--teal);
  color: var(--on-teal);
}

.mock-place {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.7rem 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.85rem;
  font-weight: 650;
}

.mock-place .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.mock-kicker {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mock-kicker + p,
.mock-kicker + ul {
  margin-top: 0.3rem;
}

.mock-chips {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mock-chips li {
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.mock-entry {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  background: var(--teal-soft);
}

.mock-entry strong,
.mock-sub {
  display: block;
}

.mock-sub {
  color: var(--muted);
  font-size: 0.85rem;
}

.mock-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: var(--teal);
  color: var(--on-teal);
}

.mock-trust {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.mock-trust .icon {
  color: var(--teal);
}

.mock-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.2rem 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  background: var(--surface2);
}

.mock-meta dt {
  color: var(--muted);
}

.mock-meta dd {
  margin: 0;
  font-weight: 650;
}

.mock-due {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 700;
}

.mock-action {
  margin-left: auto;
  padding: 0.05rem 0.65rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.8rem;
}

.mock-todo {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.mock-todo li {
  position: relative;
  padding-left: 1.65rem;
}

.mock-todo li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--line-strong);
  border-radius: 4px;
}

.mock-note {
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

/* FAQ: <details> per question, no script. The chevron is drawn from two borders (no text). */
.faq {
  display: grid;
  gap: 0.6rem;
  margin: 0 0 1rem;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.faq summary {
  position: relative;
  padding: 0.85rem 3rem 0.85rem 1.15rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  position: absolute;
  right: 1.25rem;
  top: 1.15rem;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--indigo);
  border-bottom: 2px solid var(--indigo);
  transform: rotate(45deg);
}

.faq summary:hover {
  color: var(--indigo);
}

.faq details[open] > summary {
  border-bottom: 1px solid var(--line);
}

.faq details[open] > summary::after {
  top: 1.4rem;
  transform: rotate(-135deg);
}

.faq .answer {
  padding: 0.8rem 1.15rem 0.1rem;
}

/*
 * Privacy architecture ("So schützen wir Ihre Daten"): the path of a question, one step per
 * system. The numbers come from a counter; a line joins them. The label above each heading says
 * on whose systems the step runs (class where-<kind>; all pairs WCAG 2.2 AA in both schemes).
 */
.flow {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  counter-reset: flow;
}

.flow > li {
  counter-increment: flow;
  position: relative;
  padding: 0 0 1.25rem 3rem;
}

.flow > li::before {
  content: counter(flow);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--teal);
  color: var(--on-teal);
  font-weight: 800;
}

.flow > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(1rem - 1px);
  top: 2.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: var(--line-strong);
}

.flow > li > p:last-child {
  margin-bottom: 0;
}

.flow .where {
  display: inline-block;
  margin: 0.2rem 0 0.4rem;
  padding: 0.1rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--teal-soft);
  color: var(--teal);
}

.flow .where-server {
  background: var(--indigo-soft);
  color: var(--indigo);
}

.flow .where-model {
  background: var(--warn-soft);
  color: var(--warn);
}

.flow .where-sources {
  background: var(--surface2);
  color: var(--muted);
}

/* Legal pages */
.legal h1 {
  font-size: clamp(1.75rem, 6.5vw, 2.4rem);
}

.legal h2 {
  font-size: 1.2rem;
  margin-top: 2rem;
}

.legal address {
  font-style: normal;
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Open items that block the launch. They stay visible until somebody resolves them. */
mark.todo {
  background: var(--todo-bg);
  color: var(--todo-ink);
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  font-weight: 600;
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer .wrap {
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
}

.site-footer p {
  margin: 0 0 0.75rem;
}

.site-footer nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}

@media (min-width: 40rem) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }

  .facts {
    grid-template-columns: repeat(3, 1fr);
  }

  .search-home .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .countries {
    grid-template-columns: 1fr 1fr;
  }

  .preview {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .preview figcaption {
    grid-column: 1 / -1;
  }
}

@media (min-width: 46rem) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Contact addresses and the public operator footer. */
.contact-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-links li > a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  height: 100%;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
}

.contact-links li > a:hover {
  border-color: var(--indigo);
  background: var(--indigo-soft);
}

.contact-role {
  color: var(--ink);
  font-size: 0.97rem;
  font-weight: 700;
}

.contact-address {
  grid-column: 1;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.contact-links li > a::after {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  margin-inline-start: 0.6rem;
}

.site-footer {
  background: var(--surface);
}

.site-footer .footer-brand {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.footer-brand a {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 750;
}

.footer-brand > a::after {
  content: none;
}

.site-footer .footer-products ul,
.site-footer .footer-legal ul {
  column-gap: 1.1rem;
}

.footer-products a,
.footer-legal a {
  display: inline-block;
  padding-block: 0.15rem;
}

.footer-legal {
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}

/* Reserve the same visual and number rows even when a translated caption wraps. */
.coverage-snapshot .facts > li {
  --reach-art-height: clamp(3rem, 7vw, 4.3rem);
  position: relative;
  display: grid;
  grid-template-rows: var(--reach-art-height) auto 1fr;
  gap: .3rem;
  align-items: start;
  align-content: start;
  container-type: inline-size;
}
.coverage-snapshot .facts strong {
  font-size: clamp(1rem, 15.5cqi, 2rem);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.coverage-snapshot .facts > li:not(.connected-stat)::before {
  content: "";
  display: block;
  inline-size: clamp(1.85rem, 4.5vw, 2.45rem);
  aspect-ratio: 1;
  align-self: center;
  grid-row: 1;
  background-color: var(--teal);
  mask: url("reach-symbols.96ee8dd16a.svg") var(--symbol-x, 0%) center / 300% 100% no-repeat;
}
/* The positions also cover cached fragments from the preceding backend release. */
.coverage-snapshot :is(.datasets-stat, .facts > li:nth-child(3)) { --symbol-x: 50%; }
.coverage-snapshot .index-entries-stat { --symbol-x: 100%; }
.coverage-snapshot .connected-stat {
  position: relative;
  background: linear-gradient(140deg, var(--surface), var(--teal-soft) 160%);
}
.connected-stat .globe-face {
  display: block;
  inline-size: var(--reach-art-height);
  aspect-ratio: 1;
  align-self: center;
  background: url("globe-still.49529b6ddd.webp") center / 100% no-repeat;
}
.coverage-snapshot .stat-target,
.connected-stat > a { color: var(--muted); font-size: 0.92rem; line-height: 1.4; }
.coverage-snapshot .stat-target:hover,
.connected-stat > a:hover { color: var(--teal); }
.connected-stat > a::after {
  content: ""; display: inline-block; width: .42em; height: .42em; margin-inline-start: .32em;
  border-block-start: 1.5px solid currentColor; border-inline-end: 1.5px solid currentColor; transform: rotate(45deg);
}
@container (max-width: 10rem) {
  .connected-stat > a::after { display: none; }
}
.connected-stat > a::before { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.connected-stat:has(> a:focus-visible) { outline: 3px solid var(--indigo); outline-offset: 2px; }
.connected-stat .globe-control { z-index: 1; }
.coverage-snapshot .stat-target {
  display: grid;
  grid-row: 2 / 4;
  align-self: stretch;
  align-content: start;
  gap: .3rem;
}
.coverage-snapshot .stat-target::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}
.coverage-snapshot .stat-target > :is(strong, span) { position: relative; z-index: 1; }
.coverage-snapshot li:has(.stat-target:focus-visible) {
  outline: 3px solid var(--indigo);
  outline-offset: 2px;
}
.coverage-snapshot .reach-scope { margin-block: 0.75rem 0.2rem; font-size: 0.92rem; }
.reach-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; margin-block: 0.55rem; }
.reach-links a { display: inline-flex; align-items: center; min-height: 2rem; font-size: 0.9rem; }
.coverage-snapshot .fineprint { margin-block: 0.4rem 0; }
.globe-control { display: none; }
@media (prefers-color-scheme: dark) {
  .globe-face { filter: invert(1) hue-rotate(151deg) saturate(.65) brightness(1.45); }
}
@keyframes globe-longitude { to { background-position-x: 109.090909%; } }
@keyframes globe-latitude-strip { to { background-position-y: 109.090909%; } }
@media (prefers-reduced-motion: no-preference) {
  .connected-stat .globe-face {
    background-image: url("globe-spin.2e203e34cb.webp");
    background-size: 1200% 1200%;
    background-position: 0 0;
    animation: globe-longitude 1.8s steps(12, end) infinite,
               globe-latitude-strip 21.6s steps(12, end) infinite;
  }
  .connected-stat:has(.globe-control input:checked) .globe-face { animation-play-state: paused; }
  .globe-control {
    position: absolute;
    inset-block-start: .3rem;
    inset-inline-end: .3rem;
    display: grid;
    place-items: center;
    inline-size: 2.3rem;
    block-size: 2.3rem;
    border-radius: 50%;
    color: var(--teal);
    cursor: pointer;
  }
  .globe-control::after { content: ""; inline-size: .48rem; block-size: .62rem; border-inline: 2px solid currentColor; }
  .globe-control:has(input:checked)::after {
    border: 0;
    background: currentColor;
    clip-path: polygon(8% 0, 100% 50%, 8% 100%);
  }
  .globe-control:hover { background: var(--teal-soft); }
  .globe-control:has(input:focus-visible) { outline: 2px solid var(--indigo); outline-offset: -2px; }
}

.index-history {
  --trend-gutter: clamp(3.25rem, 6vw, 4.25rem);
  --trend-gutter-gap: .5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-block: 1.25rem;
  padding: clamp(1rem, 2.5vw, 1.75rem);
}
.index-history > h2 { margin: 0; font-size: 1.22rem; }
.index-history .trend-period, .trend-tools, .trend-empty, .trend-axis, .trend-scale { color: var(--muted); }
.index-history .trend-period { margin: .2rem 0 clamp(1.15rem, 2vw, 1.65rem); font-size: .82rem; }
.trend-plot { margin: 0; }
.trend-plot + .trend-plot { margin-block-start: clamp(1rem, 2vw, 1.65rem); }
.trend-plot figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .55rem;
  margin-block-end: .45rem;
  font-weight: 650;
  font-size: .92rem;
}
.trend-values { color: var(--teal); white-space: nowrap; font-variant-numeric: tabular-nums; }
.trend-drawing {
  display: grid;
  grid-template-columns: var(--trend-gutter) minmax(0, 1fr);
  column-gap: var(--trend-gutter-gap);
}
.trend-scale { position: relative; font-size: .72rem; line-height: 1; font-variant-numeric: tabular-nums; }
.trend-scale span { position: absolute; inset-inline-end: 0; transform: translateY(-50%); }
/* Match the grid lines at y=6 and y=70 in the 76-unit viewBox. */
.trend-scale span:first-child { inset-block-start: calc(100% * 6 / 76); }
.trend-scale span:last-child { inset-block-start: calc(100% * 70 / 76); }
.trend-drawing svg { display: block; inline-size: 100%; block-size: clamp(8rem, 16vw, 12rem); overflow: visible; color: var(--teal); }
.trend-crawls svg { color: var(--indigo); block-size: clamp(4.5rem, 8vw, 6.5rem); }
.trend-drawing path, .trend-drawing circle { vector-effect: non-scaling-stroke; }
.trend-grid { stroke: var(--line); stroke-width: 1; }
.trend-trace, .trend-stem { stroke: currentColor; stroke-width: 1.5; }
.trend-drawing circle { r: .1px; fill: currentColor; stroke: currentColor; stroke-width: 5px; }
.trend-axis {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin-block-start: .25rem;
  margin-inline-start: calc(var(--trend-gutter) + var(--trend-gutter-gap));
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}
.trend-axis time:last-child { text-align: end; }
.trend-geography {
  border-block-start: 1px solid var(--line);
  margin-block-start: 1.1rem;
  padding-block-start: .9rem;
}
.trend-geography h3 { margin: 0 0 .55rem; font-size: .96rem; }
.trend-geography-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.25rem), 1fr));
  gap: .4rem;
  margin: 0;
}
.trend-geography-totals > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 1fr auto;
  min-inline-size: 0;
  padding: .35rem .5rem;
  border-radius: .45rem;
  background: var(--surface2);
}
.trend-geography-totals dt, .trend-geography-period, .trend-place-caption {
  color: var(--muted);
  font-size: .8rem;
}
.trend-geography-totals dt { grid-column: 1 / -1; line-height: 1.3; overflow-wrap: anywhere; }
.trend-geography-totals dd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  grid-column: 1 / -1;
  gap: 0 .3rem;
  margin: .1rem 0 0;
  font-variant-numeric: tabular-nums;
}
.trend-geography-totals > div:has(> .trend-mini) dd { grid-column: 1; }
.trend-geography-totals dd strong { font-size: 1.15rem; }
.trend-geography small[data-direction="up"],
.trend-geography-totals dd small { color: var(--teal); font-weight: 650; }
.trend-geography small[data-direction="down"] { color: var(--warn); font-weight: 650; }
.trend-mini {
  display: inline-flex;
  flex: none;
  align-items: end;
  align-self: end;
  gap: 2px;
  block-size: 1rem;
  margin-inline-start: auto;
  margin-block-end: .2rem;
  color: var(--teal);
}
.trend-mini i {
  display: block;
  inline-size: 2px;
  block-size: calc(var(--trend-level, 1) * .11rem + .08rem);
  border-radius: 1px;
  background: currentColor;
}
.trend-mini [data-level="2"] { --trend-level: 2; }
.trend-mini [data-level="3"] { --trend-level: 3; }
.trend-mini [data-level="4"] { --trend-level: 4; }
.trend-mini [data-level="5"] { --trend-level: 5; }
.trend-mini [data-level="6"] { --trend-level: 6; }
.trend-mini [data-level="7"] { --trend-level: 7; }
.trend-mini [data-level="8"] { --trend-level: 8; }
.trend-geography-period { margin: .7rem 0 .35rem; }
.trend-place-caption { margin: .55rem 0 .2rem; }
.trend-place-heading { margin: .5rem 0 .18rem; font-size: .84rem; }
.trend-places {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: .1rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.trend-places li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) fit-content(50%);
  align-items: baseline;
  gap: 0 .45rem;
  min-inline-size: 0;
  border-block-end: 1px solid var(--line);
  font-size: .82rem;
  overflow-wrap: anywhere;
}
.trend-places a { min-block-size: 1.5rem; justify-self: start; }
.trend-places li > span {
  min-inline-size: 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: end;
}
.trend-place-baseline, .trend-places .trend-geography-period {
  color: var(--muted);
  font-size: .71rem;
  line-height: 1.35;
  margin: 0 0 .15rem;
  text-align: end;
}
.trend-place-baseline { grid-column: 1 / -1; }
.trend-places .trend-geography-period { display: block; }
.trend-tools {
  margin: 1.05rem 0 .35rem;
  padding-block-start: .75rem;
  border-block-start: 1px solid var(--line);
  font-size: .86rem;
}
.trend-empty { margin: .55rem 0 .25rem; font-size: .86rem; }
.trend-history summary { width: fit-content; cursor: pointer; padding-block: .3rem; color: var(--indigo); font-weight: 650; }
.trend-history table { width: 100%; table-layout: fixed; margin-block: .65rem; border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; }
.trend-history caption { text-align: start; font-weight: 650; }
.trend-history th, .trend-history td { padding: .32rem .2rem; text-align: end; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.trend-history th:first-child { width: 40%; text-align: start; }
.trend-history tbody th { font-weight: 400; }

.check-monitor {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check-history { flex: 1 1 12rem; min-width: 0; }

.check-history summary {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  list-style: none;
  min-height: 44px;
  cursor: pointer;
}

.check-history summary::-webkit-details-marker { display: none; }

.check-history summary::after {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  flex: none;
  border-inline-end: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  transform: rotate(45deg);
}

.check-history[open] summary::after { transform: rotate(225deg); }
.check-heading { font-size: 0.94rem; font-weight: 750; }
.check-heading small { display: block; font-size: 0.78rem; color: var(--muted); font-weight: 500; }

.check-trace {
  margin-inline-start: auto;
  display: inline-grid;
  grid-template-columns: repeat(6, minmax(0.25rem, 0.58rem));
  align-items: end;
  gap: 0.16rem;
  height: 1.6rem;
}

.check-bin { height: 0.18rem; border-radius: 2px; background: var(--line-strong); }
.check-bin-1 { height: 0.45rem; background: var(--teal); }
.check-bin-2 { height: 0.9rem; background: var(--teal); }
.check-bin-3 { height: 1.4rem; background: var(--teal); }

@media (prefers-reduced-motion: no-preference) {
  .check-bin-recent { animation: recent-check-arrival 0.55s ease-out 1; transform-origin: bottom; }
}

@keyframes recent-check-arrival {
  from { transform: scaleY(0.3); }
  to { transform: scaleY(1); }
}

.check-history table { width: 100%; margin-block: 0.45rem 0.15rem; font-size: 0.85rem; border-collapse: collapse; }
.check-history caption { text-align: start; padding-block-end: 0.4rem; color: var(--muted); }
.check-history th, .check-history td { text-align: start; padding: 0.25rem; border-block-end: 1px solid var(--line); }
.check-history td, .check-history thead th:last-child { text-align: end; font-variant-numeric: tabular-nums; }
.check-history tbody th { font-weight: 500; font-variant-numeric: tabular-nums; }
.check-reload { margin: 0; flex: none; }
.check-reload button { min-height: 44px; padding: 0.25rem 0.45rem; color: var(--indigo); border: 0; border-radius: 4px; background: transparent; font: inherit; font-size: 0.85rem; font-weight: 650; cursor: pointer; }
.check-history summary:focus-visible, .check-reload button:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
.check-reload button:hover { background: var(--indigo-soft); }
@media (max-width: 34rem) {
  .check-monitor { display: block; }
  .check-reload { margin-block-start: 0.15rem; }
}

.crawl-activity {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.45rem 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.crawl-heading { margin: 0; font-size: 1rem; }
.crawl-activity .crawl-state,
.crawl-activity .crawl-time { margin: 0; padding: 0; background: transparent; }
.crawl-activity .crawl-state { display: flex; align-items: center; gap: 0.4rem; font-size: 0.86rem; font-weight: 650; }
.crawl-signal { flex: none; width: 0.6rem; height: 0.6rem; border: 2px solid var(--muted); border-radius: 50%; }
[data-crawl-state="active"] .crawl-signal { border-color: var(--teal); background: var(--teal); }
[data-crawl-state="interrupted"] .crawl-signal,
[data-crawl-state="stale"] .crawl-signal { border-style: dashed; }
.crawl-metrics {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0;
  border-block-start: 1px solid var(--line);
  padding-block-start: 0.45rem;
}
.crawl-metrics > div { min-width: 0; }
.crawl-metrics dt { color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; }
.crawl-metrics dd { margin: 0; font-size: 1.2rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.crawl-activity .crawl-time { grid-column: 1 / -1; color: var(--muted); font-size: 0.78rem; }
.crawl-follow { display: inline-flex; align-items: center; min-height: 44px; font-size: 0.9rem; }
.crawl-watch { padding-block: clamp(1.5rem, 4vw, 3rem); }
.crawl-watch > .wrap { max-width: 43rem; }
.crawl-watch .crawl-activity { margin-block-start: 0.65rem; }
@media (max-width: 36rem) {
  .crawl-activity { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  [data-crawl-state="active"] .crawl-signal { animation: crawl-checkpoint-pulse 850ms ease-out 2; }
}
@keyframes crawl-checkpoint-pulse {
  from { outline: 2px solid var(--teal); outline-offset: 0; }
  to { outline: 0 solid transparent; outline-offset: 4px; }
}
.crawl-activity .crawl-growth {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font-size: 0.85rem;
}

.map-explorer .wrap { max-width: 56rem; }
.map-back, .map-caption, .map-updated, .map-snapshot { font-size: .87rem; }
.map-back { display: inline-flex; align-items: center; min-height: 2.75rem; }
.map-back::before { content: "‹"; margin-inline-end: .4rem; font-size: 1.35rem; }
.map-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.map-heading h1 { margin: .6rem 0 0; font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.12; }
.map-caption { display: block; color: var(--muted); margin-block-end: .45rem; font-weight: 550; letter-spacing: normal; }
.map-picker { flex: auto; text-align: end; }
.map-picker summary, .state-directory summary { color: var(--teal); cursor: pointer; font-weight: 650; }
.map-picker summary {
  display: inline-flex; gap: .7rem; align-items: center; padding: .55rem .9rem;
  border: 1px solid var(--line-strong); border-radius: 2rem; background: var(--surface);
}
.map-picker summary::after { content: "⌄"; line-height: 1; }
.map-picker summary::-webkit-details-marker { display: none; }
.map-picker [open] summary::after { transform: rotate(180deg); }
.map-picker:has([open]) { flex-basis: 100%; text-align: start; }
.map-picker .country-apps { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); text-align: start; margin: .75rem 0; }
.map-picker .country-app { grid-template-columns: auto auto 1fr; }
.map-picker .country-app[aria-current] { border-color: var(--teal); background: var(--teal-soft); }
.map-intro { margin: .8rem 0 1.2rem; color: var(--muted); }
.national-view, .country-coverage:has(.state-map) {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(12rem, .85fr);
  gap: .6rem 1.5rem; align-items: start;
}
.national-view { margin-block-start: 1.2rem; align-items: center; }
.country-coverage:has(.state-map) { grid-template-areas: "map counts" "key counts" "summary counts" "time counts" "regions regions"; }
.state-map, .country-outline {
  display: block; width: 100%; height: auto; max-height: 28rem; aspect-ratio: 1;
  border: 1px solid var(--line); border-radius: var(--radius); background: radial-gradient(ellipse at center, var(--teal-soft), var(--surface) 78%);
}
.country-outline { object-fit: contain; }
.state-map { grid-area: map; }
.map-explorer {
  --map-none: #83909d;
  --map-one: #81b9b2;
  --map-few: #499d92;
  --map-many: #177d71;
  --map-most: #004d46;
}
[data-municipality-band="0"] { --map-color: var(--map-none); }
[data-municipality-band="1"] { --map-color: var(--map-one); }
[data-municipality-band="2-5"] { --map-color: var(--map-few); }
[data-municipality-band="6-10"] { --map-color: var(--map-many); }
[data-municipality-band="11+"] { --map-color: var(--map-most); }
.map-state { color: var(--map-color, var(--teal)); }
.map-legend { grid-area: key; display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .75rem; color: var(--muted); font-size: .83rem; }
.map-legend-label { flex-basis: 100%; font-weight: 600; }
.map-legend [data-municipality-band] { display: inline-flex; align-items: center; gap: .28rem; }
.map-legend [data-municipality-band]::before { content: ""; width: .62rem; height: .62rem; background: var(--map-color); border: 1px solid var(--muted); border-radius: 50%; }
.map-state:is(:hover, :focus-visible) { color: var(--indigo); --map-region-stroke: var(--indigo); outline: none; }
.map-summary { grid-area: summary; margin: .25rem 0 0; font-weight: 650; }
.map-snapshot { color: var(--muted); margin-block: .65rem 0; }
.map-updated { grid-area: time; margin: 0; color: var(--muted); }
.state-directory { grid-area: regions; margin-block-start: .4rem; }
.state-directory summary { padding-block: .6rem; }
.state-list { width: 100%; border-collapse: collapse; font-size: .93rem; }
.state-list :is(th, td) { padding: .45rem .35rem; border-block-end: 1px solid var(--line); text-align: end; }
.state-list th:first-child { text-align: start; }
.state-list th a { display: inline-block; padding-block: .18rem; }
.state-list th small { color: var(--muted); font: .8rem var(--mono); }
.country-records { grid-area: counts; }
.country-records ul { list-style: none; margin: 0; padding: 0; }
.country-records a {
  display: flex; align-items: baseline; justify-content: space-between; gap: .7rem;
  padding: .6rem .35rem; border-block-end: 1px solid var(--line); color: var(--muted); font-size: .93rem;
}
.country-records a strong { color: var(--teal); font-size: 1.23rem; font-variant-numeric: tabular-nums; }
.country-records li:first-child a { display: grid; justify-content: start; gap: 0; line-height: 1.25; padding-block: .2rem .9rem; }
.country-records li:first-child strong { font-size: clamp(2.1rem, 4vw, 3.4rem); letter-spacing: -.045em; }
.country-records a:hover, .state-list a:hover { color: var(--indigo); background: var(--indigo-soft); }
.map-assistant { margin-block: 1.5rem 0; }
@media (max-width: 38rem) {
  .national-view, .country-coverage:has(.state-map) { display: flex; flex-direction: column; align-items: stretch; }
  .country-outline, .state-map { max-height: 21rem; }
  .state-list { font-size: .84rem; }
  .map-picker .country-apps { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
}
@media (prefers-color-scheme: dark) {
  .map-explorer { --map-none: #737f8b; --map-one: #326f68; --map-few: #409a8e; --map-many: #69c8ba; --map-most: #aff5e9; }
  .country-outline { filter: brightness(1.25); }
}
@media (forced-colors: active) {
  .map-state { color: LinkText; }
  .map-state:focus-visible { --map-region-stroke: Highlight; }
}

.city-directory { grid-column: 1 / -1; }
.city-directory ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .55rem; padding: 0; list-style: none; }
.city-link { display: grid; align-content: start; height: 100%; gap: .2rem; padding: .85rem 1rem; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.city-link span { color: var(--muted); font-size: .88rem; font-weight: 450; }
.city-link:hover, .city-link:focus-visible { color: var(--indigo); border-color: var(--indigo); background: var(--indigo-soft); }
.local-guide-links { margin-block-start: 1.65rem; padding-block-start: 1rem; border-block-start: 1px solid var(--line); }
.local-guide-links h2 { margin-block: .25rem; }
.local-guide-links p { margin-block: .25rem .7rem; color: var(--muted); }
.local-guide-links .search-examples a { min-height: 2.75rem; display: inline-flex; align-items: center; }
@media (max-width: 38rem) {
  .city-directory ul { grid-template-columns: 1fr; }
}

.national-view:has(.region-map) { display: block; }
.national-view:has(.region-map) > .country-outline { display: none; }
.country-coverage:has(.region-map) {
  grid-template-areas: "map filter" "map counts";
  grid-template-rows: auto 1fr;
}
.region-display { grid-area: map; position: relative; }
.region-display .map-legend { margin-block-start: .65rem; }
.region-map .map-state:not(:hover, :focus-visible) {
  --map-region-stroke: color-mix(in srgb, var(--map-color) 38%, transparent);
}
.map-region-picker {
  grid-area: filter;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-block-end: .35rem;
}
.map-region-picker .question-label { display: block; margin-block-end: .35rem; font-weight: 650; }
.map-region-picker .search-bar { display: flex; flex-wrap: wrap; gap: .45rem; }
.map-region-picker select {
  flex: 1; min-width: min(100%, 9rem); max-width: 100%; padding: .55rem .7rem;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px;
  color: var(--ink); font: inherit;
}
[data-region-band="0"] { --map-color: var(--map-none); }
[data-region-band="1-99"] { --map-color: var(--map-one); }
[data-region-band="100-999"] { --map-color: var(--map-few); }
[data-region-band="1000+"] { --map-color: var(--map-most); }
.map-legend [data-region-band] { display: inline-flex; align-items: center; gap: .28rem; }
.map-legend [data-region-band]::before {
  content: ""; width: .62rem; height: .62rem; background: var(--map-color);
  border: 1px solid var(--muted); border-radius: 50%;
}
