/*
 * CRE Layer design system.
 *
 * This file holds the tokens, the page shell and every shared component.
 * Pages never define their own colors, radii or font sizes: they use the
 * tokens and classes below. Page layout lives in the page stylesheets
 * (home.css, data.css, docs.css, company.css, legal.css, account.css,
 * map.css).
 */

/* ----------------------------------------------------------------- fonts */

@font-face {
  font-family: "Inter Variable";
  src: url("/site/vendor/fonts/inter-latin-wght-normal.woff2?v=6eead46ed9e84899")
    format("woff2-variations");
  font-weight: 100 900;
  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;
}

/* Arial cut to Inter's measurements, so the page does not move when the
   real face arrives. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107.4%;
  ascent-override: 90.2%;
  descent-override: 22.48%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "JetBrains Mono Variable";
  src: url("/site/vendor/fonts/jetbrains-mono-latin-wght-normal.woff2?v=6eead46ed9e84899")
    format("woff2-variations");
  font-weight: 100 800;
  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;
}

/* ---------------------------------------------------------------- tokens */

:root {
  color-scheme: light;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f5f6f3;
  --text: #0d1f18;
  --muted: #55635e;
  --line: #e4e7e1;
  --field-line: #76847e;
  --accent: #123f38;
  --accent-hover: #0b2b26;
  --on-accent: #ffffff;
  --highlight: #d3ee8d;
  --on-highlight: #18211f;
  --link: #0e5f54;
  --focus: #005e54;
  --note-bg: #f5f6f3;
  --note-line: #e4e7e1;
  --note-text: #0d1f18;
  --warn-bg: #fff8e6;
  --warn-line: #e6c56a;
  --warn-text: #5c4409;
  --error-bg: #fdecea;
  --error-line: #e3a59c;
  --error-text: #7a1f14;
  --ok-bg: #dcf2e8;
  --ok-text: #0f5c41;
  --code-bg: #0f1a17;
  --code-text: #dbe7e3;
  --code-muted: #9fb3ac;
  --map-pin: #0e5f54;
  --accent-soft: #e8f0ec;
  --line-strong: #b9c2bb;
  --code-accent: #c6e97a;
  --scrim: rgb(13 31 24 / 36%);

  --font-sans:
    "Inter Variable", "Inter Fallback", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  --font-mono:
    "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;

  --text-xs: 13px;
  --text-sm: 14px;
  --text-base: 17px;
  --text-lg: 21px;
  --text-xl: 20px;
  --text-2xl: clamp(26px, 3.2vw, 36px);
  --text-3xl: clamp(34px, 4.6vw, 52px);
  --text-display: clamp(40px, 6.2vw, 72px);
  --text-eyebrow: 13px;
  --text-mono: 14px;
  --text-price: 44px;
  --text-menu: 24px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;
  --section-space: var(--space-9);
  --section-head-space: var(--space-7);
  /* The space above the first heading of a page, the same on every page of
     its kind: marketing pages, and pages that are one form. */
  --hero-space: var(--space-9);
  /* One line of crumbs and the space under it (.breadcrumbs-list). */
  --breadcrumb-row: calc(20px + var(--space-5));
  --form-top-space: clamp(var(--space-7), min(14vh, 10vw), var(--space-10));
  --gutter: clamp(20px, 5vw, 64px);
  --gutter-max: 64px;
  --content: 1080px;
  --wide: 1200px;
  --prose: 680px;
  --content-width: var(--content);
  --prose-width: var(--prose);

  /* Code surfaces are dark in both themes, so these do not change. */
  --code-line: rgb(255 255 255 / 10%);
  --code-line-strong: rgb(255 255 255 / 18%);
  --code-hover: rgb(255 255 255 / 7%);
  --code-inset: rgb(0 0 0 / 24%);

  --radius-control: 10px;
  --radius-card: 16px;
  --radius-code: 6px;
  --radius-search: 20px;
  --radius-pill: 999px;

  --shadow-raised: 0 1px 2px rgb(13 31 24 / 4%), 0 12px 32px rgb(13 31 24 / 8%);
  --shadow-stage: 0 2px 4px rgb(13 31 24 / 4%), 0 32px 80px rgb(13 31 24 / 12%);
  --shadow-search-focus:
    0 0 0 4px rgb(18 63 56 / 12%), 0 8px 24px rgb(13 31 24 / 8%);
  /* The edge a raised surface gets where the theme has no shadow. */
  --raised-line: var(--line);

  --control-height: 44px;
  --control-height-sm: 36px;
  --control-height-lg: 52px;
  --search-height: 64px;

  --fast: 120ms;
  --slow: 240ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --header-height: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #0b1210;
    --surface: #121b18;
    --surface-alt: #17221e;
    --text: #edf2ef;
    --muted: #a3b2ac;
    --line: #24312c;
    --field-line: #7f918a;
    --accent: #c6e97a;
    --accent-hover: #d3ee8d;
    --on-accent: #14200f;
    --highlight: #c6e97a;
    --on-highlight: #14200f;
    --link: #8fd8c1;
    --focus: #8fd8c1;
    --note-bg: #17221e;
    --note-line: #24312c;
    --note-text: #edf2ef;
    --warn-bg: #342a12;
    --warn-line: #7a6223;
    --warn-text: #f1d996;
    --error-bg: #3a1a16;
    --error-line: #7d362c;
    --error-text: #f5c4bc;
    --ok-bg: #163527;
    --ok-text: #a6e2c6;
    --code-bg: #070c0b;
    --code-text: #dbe7e3;
    --code-muted: #9fb3ac;
    --map-pin: #8fd1b8;
    --accent-soft: #1b2a25;
    --line-strong: #3a4a44;
    --code-accent: #c6e97a;
    --scrim: rgb(0 0 0 / 56%);

    /* No shadows on the dark page: a raised surface gets a stronger edge. */
    --shadow-raised: none;
    --shadow-stage: none;
    --shadow-search-focus: 0 0 0 4px rgb(198 233 122 / 16%);
    --raised-line: var(--line-strong);
  }
}

@media (max-width: 640px) {
  :root {
    --section-space: var(--space-8);
    --section-head-space: var(--space-6);
    --hero-space: var(--space-7);
    --search-height: 56px;
    --text-base: 16px;
    --text-lg: 18px;
    --text-xl: 18px;
    --text-eyebrow: 12px;
    --text-mono: 13px;
  }
}

@media (max-width: 899px) {
  :root {
    --header-height: 56px;
  }
}

@media (min-width: 641px) and (max-width: 899px) {
  :root {
    --hero-space: var(--space-8);
    --text-lg: 19px;
  }
}

@media (min-width: 1320px) {
  :root {
    --section-space: var(--space-10);
  }
}

/* ------------------------------------------------------------------ base */

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

html {
  font-family: var(--font-sans);
  /* The reader's own browser size is kept. */
  font-size: 100%;
  line-height: 1.6;
  font-feature-settings: "kern", "calt", "cv11";
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-size: var(--text-base);
  text-wrap: pretty;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-4);
  color: var(--text);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h2 {
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h4 {
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.5;
}

/* Home only: the one display line. */
.display {
  font-size: var(--text-display);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

p {
  margin: 0 0 var(--space-4);
}

:where(.section, .prose) :where(p, li, dd) {
  max-width: 60ch;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
}

:where(p, li, td, dd, dt, th, h1, h2, h3, h4, label, span) > code {
  padding: 1px 5px;
  border-radius: var(--radius-code);
  background: var(--surface-alt);
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

img,
svg {
  max-width: 100%;
}

.icon {
  flex: none;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

/* The one focus color that shows on the always-dark code surfaces. */
:where(.code-frame, .agent-panel, .code-pane) :focus-visible {
  outline-color: var(--code-accent);
}

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

.eyebrow {
  margin: 0 0 var(--space-3);
  color: var(--muted);
  font-size: var(--text-eyebrow);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.lede {
  color: var(--muted);
  font-size: var(--text-lg);
  line-height: 1.45;
  letter-spacing: -0.005em;
  max-width: 44ch;
}

.data {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  line-height: 20px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.field-name {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--muted);
}

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

.fine-print {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.4;
}

/* ---------------------------------------------------------------- header */

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-control);
  background: var(--highlight);
  color: var(--on-highlight);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

/* The hairline under the bar shows once the page has scrolled (shell.js
   sets data-scrolled on <html>), or while the menu is open. */
.site-header::before {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--line);
  content: "";
  opacity: 0;
  transition: opacity var(--fast) var(--ease);
}

html[data-scrolled] .site-header::before,
html.menu-open .site-header::before,
body.full-screen .site-header::before {
  opacity: 1;
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  height: var(--header-height);
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  flex: none;
  width: 28px;
  height: 28px;
}

.brand-mark path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
}

.brand-mark .brand-mark-top {
  fill: var(--highlight);
}

.site-nav ul,
.site-menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav ul {
  display: flex;
  gap: var(--space-1);
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-control);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-nav a[aria-current="page"]::after {
  position: absolute;
  right: var(--space-3);
  bottom: 8px;
  left: var(--space-3);
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  content: "";
}

.header-actions {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  /* Wide enough for either state, so the swap never moves the layout. */
  min-width: 236px;
  margin-left: auto;
}

.header-slot {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

html:not([data-signed-in]) .auth-in,
html[data-signed-in] .auth-out {
  display: none;
}

.header-link {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 var(--space-2);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
}

.header-link:hover {
  text-decoration: underline;
}

.menu-button {
  display: none;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  color: var(--text);
  cursor: pointer;
}

.menu-button .icon-close,
.menu-button[aria-expanded="true"] .icon-menu {
  display: none;
}

.menu-button[aria-expanded="true"] .icon-close {
  display: block;
}

/* The phone menu: a full-width sheet under the bar, one large link a row,
   with a scrim over the page behind it. */
.site-menu {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  z-index: 1;
  max-height: calc(100dvh - var(--header-height));
  padding: var(--space-3) var(--gutter) var(--space-6);
  overflow-y: auto;
  border-bottom: 1px solid var(--raised-line);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
  animation: sheet-in var(--slow) var(--ease);
}

.site-menu a {
  display: flex;
  align-items: center;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: var(--text-menu);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-menu li:last-child a,
html:not([data-signed-in]) .site-menu li.auth-out a {
  border-bottom: 0;
}

.site-menu a[aria-current="page"] {
  color: var(--link);
}

html.menu-open {
  overflow: hidden;
}

html.menu-open .site-header {
  background: var(--surface);
}

html.menu-open .site-header::after {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  height: 100vh;
  height: 100dvh;
  background: var(--scrim);
  content: "";
  animation: scrim-in var(--slow) var(--ease);
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes scrim-in {
  from {
    opacity: 0;
  }
}

@media (max-width: 899px) {
  .site-header-inner {
    gap: var(--space-3);
  }

  .site-nav,
  .header-link,
  .header-slot .button-quiet {
    display: none;
  }

  .header-actions {
    min-width: 0;
  }

  .menu-button {
    display: inline-flex;
  }

  .header-slot .button-sm {
    padding: 0 var(--space-4);
  }
}

@media (min-width: 900px) {
  .site-menu,
  html.menu-open .site-header::after {
    display: none;
  }
}

/* Six links: between the phone menu and a roomy laptop the bar is tighter,
   so it still fits beside the two buttons. At 900px the six at full spacing
   ran 18px past the window. */
@media (min-width: 900px) and (max-width: 1039px) {
  .site-header-inner {
    gap: var(--space-3);
  }

  .site-nav ul {
    gap: 0;
  }

  .site-nav a {
    padding: 0 var(--space-2);
  }

  .site-nav a[aria-current="page"]::after {
    right: var(--space-2);
    left: var(--space-2);
  }
}

/* Full-screen pages (the map): one 56px row at every width. */

body.full-screen {
  --header-height: 56px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body.full-screen .site-header {
  position: relative;
  flex: none;
}

body.full-screen .site-header-inner {
  max-width: none;
}

body.full-screen .site-main {
  flex: 1;
  min-height: 0;
  height: calc(100dvh - 56px);
}

body.full-screen .header-actions {
  min-width: 0;
}

body.full-screen .header-slot .button-quiet {
  display: inline-flex;
}

/* ------------------------------------------------------------------ main */

.site-main {
  display: block;
  min-height: 50vh;
}

.section {
  padding: var(--section-space)
    max(var(--gutter), calc((100% - var(--content)) / 2));
}

/* The first section of a page starts one hero space under the header, so
   the first heading sits at the same height on every page. Form pages
   (.section-tight) set their own, also one value for all of them. */
.site-main > .section:first-child:not(.section-tight) {
  padding-top: var(--hero-space);
}

/* A page with breadcrumbs gives their row back, so its h1 sits on the same
   line as every other page's. Never less than 24px under the header. */
.site-main
  > .section:first-child:not(.section-tight):has(
    > .section-head > .breadcrumbs
  ) {
  padding-top: max(
    var(--space-5),
    calc(var(--hero-space) - var(--breadcrumb-row))
  );
}

.section-alt {
  background: var(--surface-alt);
}

/* The closing band: one heading and one button on the soft accent. */
.section-accent {
  background: var(--accent-soft);
}

.section-tight {
  padding-block: var(--space-7);
}

.section-prose {
  padding-inline: max(var(--gutter), calc((100% - var(--prose)) / 2));
}

.section-wide {
  padding-inline: max(var(--gutter), calc((100% - var(--wide)) / 2));
}

/* Centered by default: eyebrow, heading, lede. Docs, legal and account
   pages add is-left. */
.section-head {
  max-width: 760px;
  margin: 0 auto var(--section-head-space);
  text-align: center;
}

.section-head > p {
  margin-inline: auto;
}

.section-head .button-row {
  justify-content: center;
}

.section-head.is-left {
  margin-inline: 0;
  text-align: left;
}

.section-head.is-left > p {
  margin-inline: 0;
}

.section-head.is-left > .lede {
  max-width: 60ch;
}

.section-head.is-left .button-row {
  justify-content: flex-start;
}

.section-head > :last-child,
.section > :last-child {
  margin-bottom: 0;
}

/* A faint parcel grid, masked to a soft ellipse. The only decoration, and
   only behind a hero. */
.parcel-grid {
  position: relative;
  isolation: isolate;
}

.parcel-grid::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  content: "";
  opacity: 0.4;
  -webkit-mask-image: radial-gradient(
    ellipse 70% 80% at 50% 40%,
    #000 20%,
    transparent 75%
  );
  mask-image: radial-gradient(
    ellipse 70% 80% at 50% 40%,
    #000 20%,
    transparent 75%
  );
  pointer-events: none;
}

.not-found {
  padding-block: var(--space-9);
  text-align: center;
}

.not-found > p {
  margin-inline: auto;
}

.not-found-code {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
}

.not-found .button-row {
  justify-content: center;
  margin: var(--space-6) 0 var(--space-5);
}

/* --------------------------------------------------------------- buttons */

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--control-height);
  margin: 0;
  padding: 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--fast) var(--ease);
}

.button:active {
  transform: scale(0.98);
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.button:hover:not([disabled], [aria-disabled="true"]) {
  border-color: var(--text);
}

.button-primary:hover:not([disabled], [aria-disabled="true"]) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover:not([disabled], [aria-disabled="true"]) {
  border-color: var(--text);
}

.button-quiet {
  padding: 0 var(--space-3);
  border-color: transparent;
  background: none;
  color: var(--link);
}

.button-quiet:hover:not([disabled], [aria-disabled="true"]) {
  border-color: transparent;
  background: var(--surface-alt);
}

/* A quiet link that leads somewhere: the words, then an arrow. */
.button-arrow::after {
  content: "\2192";
  transition: transform var(--fast) var(--ease);
}

.button-arrow:hover::after {
  transform: translateX(3px);
}

.button-danger {
  border-color: var(--error-line);
  background: var(--surface);
  color: var(--error-text);
}

.button-danger:hover:not([disabled], [aria-disabled="true"]) {
  border-color: var(--error-text);
  background: var(--error-text);
  color: var(--error-bg);
}

/* The header, and "Update search" in the home results. */
.button-sm {
  height: var(--control-height-sm);
  padding: 0 var(--space-4);
  font-size: var(--text-sm);
}

/* A finger needs 44px. On a touch screen or a narrow one the two small
   buttons a visitor must press are the full control height. */
@media (pointer: coarse), (max-width: 899px) {
  .header-slot .button-sm,
  .omni-update {
    height: var(--control-height);
  }
}

/* The hero and the closing band only. */
.button-lg {
  height: var(--control-height-lg);
  padding: 0 28px;
  font-size: 17px;
}

.button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.button.is-busy {
  pointer-events: none;
}

.button.is-busy::before {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: var(--radius-pill);
  content: "";
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.button-row.is-center {
  justify-content: center;
}

/* On a phone a row of large buttons stacks, full width, primary first. */
@media (max-width: 479px) {
  .button-row.is-stack {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ----------------------------------------------------------------- cards */

.card {
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.card > :last-child {
  margin-bottom: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A card in a grid fills its cell. The 68ch reading width is for lines of
   text, not for the boxes that hold them. */
.card-grid > li {
  max-width: none;
}

/* A row of exactly three cards stays three across from tablet width, so no
   card sits alone on a second row. Below that the cards stack. */
.card-grid-3 {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 720px) {
  .card-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
  }
}

.card-link {
  display: flex;
  flex-direction: column;
  color: var(--text);
  text-decoration: none;
}

/* Card grids: three across, two on a tablet, one on a phone. */
@media (min-width: 641px) and (max-width: 899px) {
  .card-grid:not(.card-grid-3) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card-link {
  transition: transform var(--fast) var(--ease);
}

.card-link:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.card h3,
.card-link h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

@media (max-width: 640px) {
  .card {
    padding: var(--space-5);
  }
}

.card-icon {
  margin-bottom: var(--space-2);
}

.card-link p {
  color: var(--muted);
}

/* One arrow link everywhere: the words, then an arrow, never underlined.
   Inside a card that is itself the link it is a span. Standing alone it is
   the link, and it gets the same look. */
.card-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: auto;
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
}

.card-arrow::after {
  content: "\2192";
  transition: transform var(--fast) var(--ease);
}

.card-link:hover .card-arrow::after,
a.card-arrow:hover::after {
  transform: translateX(4px);
}

/* A neutral bar where a value would be, when no live record may be shown. */
.record-bar {
  display: block;
  width: 60%;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--line);
}

/* ------------------------------------------------------------------ code */

.code-frame {
  margin: 0 0 var(--space-4);
  overflow: hidden;
  /* On the dark page the block is nearly the page color, so it has an edge. */
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--code-bg);
  color: var(--code-text);
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 44px;
  padding: 0 var(--space-2) 0 var(--space-4);
  border-bottom: 1px solid var(--code-line);
}

.code-lang {
  color: var(--code-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 18px;
}

.code-copy {
  height: 36px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  color: var(--code-text);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
}

.code-copy:hover {
  background: var(--code-hover);
}

.code-block {
  margin: 0;
  padding: var(--space-4);
  overflow-x: auto;
  border-radius: var(--radius-card);
  background: var(--code-bg);
  color: var(--code-text);
  font-size: var(--text-mono);
  line-height: 1.6;
  tab-size: 2;
}

.code-block:focus-visible {
  outline-color: var(--code-accent);
  outline-offset: -3px;
}

.code-frame > .code-block {
  border-radius: 0;
}

.code-block code {
  padding: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
}

@media (pointer: coarse) {
  .code-copy {
    height: 44px;
  }
}

/* ----------------------------------------------- notes, errors, banners */

.note,
.banner-error,
.form-error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--note-line);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--note-text);
  font-size: 15px;
  line-height: 24px;
}

.note > .icon {
  color: var(--muted);
}

.note.is-warning > .icon,
.note.is-success > .icon {
  color: inherit;
}

.note > .icon,
.banner-error > .icon,
.form-error > .icon {
  margin-top: 2px;
}

.note > :where(p, div),
.banner-error > :where(p, div),
.form-error > :where(p, div) {
  min-width: 0;
  max-width: none;
  margin: 0;
}

.note a,
.banner-error a,
.form-error a,
.banner a {
  color: inherit;
  font-weight: 600;
}

.note.is-warning {
  border-color: var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-text);
}

.note.is-success {
  border-color: color-mix(in srgb, var(--ok-text) 35%, transparent);
  background: var(--ok-bg);
  color: var(--ok-text);
}

.banner-error,
.form-error {
  border-color: var(--error-line);
  background: var(--error-bg);
  color: var(--error-text);
}

.form-error {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-control);
  font-size: var(--text-sm);
  line-height: 20px;
}

/* A full-width strip directly under the header, for account status. */
.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--gutter);
  border-bottom: 1px solid var(--note-line);
  background: var(--note-bg);
  color: var(--note-text);
  font-size: 15px;
  line-height: 22px;
}

.banner.is-positive {
  border-color: color-mix(in srgb, var(--ok-text) 35%, transparent);
  background: var(--ok-bg);
  color: var(--ok-text);
}

.banner.is-attention {
  border-color: var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-text);
}

.banner.is-error {
  border-color: var(--error-line);
  background: var(--error-bg);
  color: var(--error-text);
}

/*
 * The cookie choice: a slim bar along the bottom edge, never a wall and
 * never a card over the page's main button. On a phone it is two short rows,
 * the sentence and the two buttons; from 1040px it is one row. While it
 * shows, the page keeps room under it (see the end of this block).
 */
.consent {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  padding: var(--space-3) var(--gutter);
  padding-bottom: max(var(--space-3), env(safe-area-inset-bottom));
  border-top: 1px solid var(--raised-line);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
  animation: consent-in var(--slow) var(--ease);
}

.consent p {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  line-height: 20px;
}

body:not(.full-screen) .consent .button-row {
  flex-wrap: nowrap;
  gap: var(--space-2);
}

body:not(.full-screen) .consent .button-row .button {
  flex: 1 1 0;
  min-width: 0;
}

body:not(.full-screen) .consent-link {
  white-space: nowrap;
}

/* consent.js measures the bar as it shows and keeps --consent-space on
   <html> in step, so a larger text size or a wrapped line still leaves the
   page room, and a control that takes focus scrolls clear of the bar. The
   fallback fits a three-line bar on a phone. */
body:not(.full-screen):has(> .consent) {
  padding-bottom: var(--consent-space, 144px);
}

html:has(> body:not(.full-screen) > .consent) {
  scroll-padding-bottom: var(--consent-space, 144px);
}

/*
 * A full-screen page (the map) has no page scroll, so a floating sheet would
 * sit on top of the search results for good: on a phone the results are at
 * the bottom of the screen, right where the sheet is. There the choice takes
 * its own row under the map and covers nothing.
 */
body.full-screen .consent {
  position: static;
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  max-width: none;
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-width: 1px 0 0;
  border-radius: 0;
  box-shadow: none;
}

body.full-screen .consent p {
  flex: 1 1 320px;
  margin: 0;
  font-size: var(--text-sm);
  line-height: 20px;
}

body.full-screen .consent .button-row {
  gap: var(--space-2);
}

body.full-screen .consent-link {
  margin-top: 0;
}

@media (max-width: 639px) {
  body.full-screen .consent .button-row {
    flex: 1 1 100%;
  }
}

/* From 1040px the sentence and the buttons share one row. */
@media (min-width: 1040px) {
  body:not(.full-screen) .consent {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding-right: max(var(--gutter), calc((100vw - var(--content)) / 2));
    padding-left: max(var(--gutter), calc((100vw - var(--content)) / 2));
  }

  body:not(.full-screen) .consent p {
    flex: 1 1 auto;
    margin: 0;
  }

  body:not(.full-screen) .consent .button-row {
    flex: none;
  }

  body:not(.full-screen) .consent .button-row .button {
    flex: none;
  }
}

@keyframes consent-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------------------------------------------------------------- badges */

/* A long badge ends in an ellipsis and never wraps. */
.badge {
  display: inline-block;
  flex: none;
  height: 24px;
  max-width: 24ch;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 22px;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.badge-live {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.badge-live::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  vertical-align: middle;
}

.badge-soon {
  border-color: var(--line);
  background: var(--surface-alt);
  color: var(--text);
}

.badge-test {
  border-color: var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-text);
}

/* ---------------------------------------------------------------- tables */

/* Hairline rows only: no outer box and no filled head. */
.table-wrap {
  margin: 0 0 var(--space-4);
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  line-height: 20px;
}

.table th,
.table td {
  padding: var(--space-3) var(--space-5) var(--space-3) 0;
  text-align: left;
  vertical-align: top;
}

.table tr > :last-child {
  padding-right: 0;
}

.table thead th {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}

.table tbody th {
  font-weight: 600;
}

.table tbody tr > * {
  border-top: 1px solid var(--line);
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* On the soft band, on any page, a table has no box of its own: the band
   shows through, and the hairlines use the stronger line to be seen. */
.section-alt .table-wrap {
  border-bottom-color: var(--line-strong);
  background: none;
}

.section-alt .table tbody tr > *,
.section-alt .table-stack .table tbody tr {
  border-top-color: var(--line-strong);
}

/* A row header that carries a badge: the name and the badge sit on one
   centre line, and the badge drops under a long name instead of pushing it. */
.table-label {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px var(--space-2);
}

/* From tablet width up a code value in any table (an error code, a route, a
   cookie name) is never broken mid-word, whatever kind of table it sits in.
   If a row cannot fit, the table scrolls inside its box. On a phone a
   stacked table gives each value the full card width instead. */
@media (min-width: 640px) {
  .table td code,
  .table th code {
    white-space: nowrap;
    overflow-wrap: normal;
  }
}

/* Short tables that must fit a phone with no sideways scroll: headers wrap
   and the columns share the width. Put table-fit on the wrap. */
.table-fit .table thead th {
  white-space: normal;
}

.table-fit .table th,
.table-fit .table td {
  overflow-wrap: break-word;
}

@media (max-width: 639px) {
  /* A wide table scrolls sideways inside its box. The first column stays in
     view, and a soft edge on the right shows there is more until the last
     column is reached. */
  .table-wrap:not(.table-fit, .table-stack) {
    background:
      linear-gradient(to left, var(--bg) 40%, transparent) right center / 48px
        100% no-repeat local,
      linear-gradient(to left, var(--line-strong), transparent) right center /
        20px 100% no-repeat scroll,
      var(--bg);
  }

  .table-wrap:not(.table-fit, .table-stack) .table tr > :first-child {
    position: sticky;
    left: 0;
    padding-right: var(--space-4);
    background: var(--bg);
  }

  /* A table whose rows read better as cards on a phone: each row is a block,
     the row header is its title and every other cell carries its column
     name from data-label. Nothing scrolls and nothing is cut. Put
     table-stack on the wrap. */
  .table-stack {
    overflow-x: visible;
  }

  .table-stack .table,
  .table-stack .table tbody,
  .table-stack .table tr,
  .table-stack .table th,
  .table-stack .table td {
    display: block;
  }

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

  .table-stack .table tbody tr {
    padding: var(--space-4) 0;
    border-top: 1px solid var(--line);
  }

  .table-stack .table tbody tr:first-child {
    border-top: 0;
  }

  .table-stack .table tbody tr > * {
    padding: 0;
    border-top: 0;
    overflow-wrap: break-word;
  }

  .table-stack .table tbody tr > * + * {
    margin-top: var(--space-2);
  }

  .table-stack .table tbody th {
    font-size: var(--text-base);
    line-height: 24px;
  }

  /* A code value that is the whole title of a card (a route, a tool name)
     stays on one line. If it is longer than the card it scrolls by itself. */
  .table-stack .table tbody th > code:only-child {
    display: inline-block;
    max-width: 100%;
    overflow-x: auto;
    overflow-wrap: normal;
    white-space: nowrap;
    vertical-align: bottom;
  }

  .table-stack .table td[data-label]::before {
    display: block;
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 18px;
    content: attr(data-label);
  }

  .table-stack .table .num {
    text-align: left;
  }
}

/* ----------------------------------------------------------------- forms */

.form {
  display: grid;
  gap: var(--space-4);
  max-width: 440px;
}

.field {
  display: grid;
  gap: var(--space-2);
}

.field > label,
.field > legend,
.field-label {
  padding: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 20px;
}

.input,
.field
  > :where(input:not([type="checkbox"], [type="radio"]), select, textarea) {
  width: 100%;
  height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--field-line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 24px;
}

/* A select draws our own caret, in the field's own colors, in place of
   the browser's arrow. Two gradients make the small triangle, so no image
   file and no color outside the tokens. */
.field > select,
.map-field > select {
  padding-right: var(--space-7);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    right 19px center,
    right 13px center;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  text-overflow: ellipsis;
  appearance: none;
  -webkit-appearance: none;
}

.field > textarea,
textarea.input {
  height: auto;
  min-height: 96px;
  padding: var(--space-2) var(--space-3);
  resize: vertical;
}

.field [aria-invalid="true"] {
  border-color: var(--error-text);
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 18px;
}

.field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  color: var(--error-text);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 18px;
}

.field-error .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  font-size: 15px;
}

.check input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

/* ------------------------------------------------ tabs, chips and steps */

.tabs {
  display: flex;
  gap: var(--space-1);
  margin: 0 0 var(--space-5);
  border-bottom: 1px solid var(--line);
}

.tabs [role="tab"] {
  position: relative;
  height: 44px;
  padding: 0 var(--space-4);
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.tabs [role="tab"]:hover,
.tabs [role="tab"][aria-selected="true"] {
  color: var(--text);
}

.tabs [role="tab"][aria-selected="true"]::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--text);
}

.chip[aria-pressed="true"],
.chip.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

@media (pointer: coarse) {
  .chip {
    min-height: 44px;
  }
}

.steps {
  display: grid;
  gap: var(--space-5);
  margin: 0 0 var(--space-5);
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  position: relative;
  min-height: 32px;
  padding-left: 48px;
  counter-increment: step;
}

.steps > li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  content: counter(step);
}

.steps > li > :where(h2, h3) {
  margin-bottom: var(--space-2);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 32px;
  letter-spacing: -0.01em;
}

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

/* --------------------------------------------------------------- pricing */

.tier {
  display: flex;
  flex-direction: column;
}

/* The featured plan: a 2px accent edge and nothing else. The padding gives
   the extra pixel back, so every card's content lines up. */
.tier.is-featured {
  padding: calc(var(--space-6) - 1px);
  border: 2px solid var(--accent);
}

@media (max-width: 640px) {
  .tier.is-featured {
    padding: calc(var(--space-5) - 1px);
  }
}

.tier > h3 {
  margin-bottom: var(--space-2);
  font-size: var(--text-xl);
}

.tier > .tier-price {
  margin: 0;
  font-size: var(--text-price);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* "From" sits above the number. Every card has the line, empty or not, so
   the five prices share one baseline. */
.tier-from {
  display: block;
  min-height: 18px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 18px;
  letter-spacing: 0;
}

.tier > .tier-price strong {
  font-weight: inherit;
}

.tier > .tier-price small {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: 0;
}

.tier > .tier-credits {
  margin: var(--space-1) 0 var(--space-4);
  font-weight: 600;
}

.tier > .tier-features {
  display: grid;
  gap: var(--space-2);
  margin: 0 0 var(--space-5);
  padding: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 20px;
  list-style: none;
}

.tier > .button {
  margin-top: auto;
}

/* ------------------------------------------------------------- fact row */

/* Three short facts in a row, hairlines between. Stacks on a phone. */
.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

/* Each cell is as tall as the row, so the hairlines are one height. A fact
   on one line sits in the middle of its cell beside one that wraps to two. */
.facts > li {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: none;
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.facts > li + li {
  border-left: 1px solid var(--line);
}

.section-alt .facts > li + li,
.section-accent .facts > li + li {
  border-color: var(--line-strong);
}

@media (max-width: 899px) {
  .facts > li {
    padding-inline: var(--space-4);
    font-size: var(--text-base);
  }
}

@media (max-width: 640px) {
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .facts > li {
    padding: var(--space-4) 0;
  }

  .facts > li + li {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

/* --------------------------------------------------------- county chips */

/* One row per state: the state, then a pill per live county. */
.county-chips {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
}

.county-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2) var(--space-3);
}

.county-state {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.county-chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.county-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: none;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.county-chip::before,
.record-card-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--highlight);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
  content: "";
}

@media (max-width: 640px) {
  .county-chips {
    justify-items: start;
  }

  .county-group,
  .county-chip-row {
    justify-content: flex-start;
  }
}

/* ------------------------------------------------------------------- faq */

/* Questions that open in place: the question is the summary. */
.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item:first-of-type {
  border-top: 1px solid var(--line);
}

.faq-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 56px;
  padding: var(--space-3) 0;
  cursor: pointer;
  list-style: none;
}

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

.faq-item > summary::after {
  flex: none;
  color: var(--muted);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: 1;
  content: "+";
  transition: transform var(--fast) var(--ease);
}

.faq-item[open] > summary::after {
  transform: rotate(45deg);
}

.faq-item > summary :where(h2, h3) {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.005em;
}

.faq-item > :not(summary) {
  color: var(--muted);
}

.faq-item > :last-child:not(summary) {
  margin-bottom: var(--space-5);
}

/* --------------------------------------------------------------- visuals */

/*
 * The three product visuals and the stage that holds them. They show one
 * real record (visuals.ts). Pages place them and never restyle them.
 */

/* The record card: address, place, four facts, source and date. A search
   result on the home page (.omni-card) is the same object, so its facts
   and its source line share these rules. */
.record-card {
  width: 100%;
  max-width: 440px;
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  text-align: left;
}

.record-card-title {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.record-card-place {
  margin: 0 0 var(--space-5);
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.record-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--space-4);
  margin: 0 0 var(--space-5);
}

.record-card-grid dt,
.omni-card-fields dt {
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.4;
}

.record-card-grid dd,
.omni-card-fields dd {
  max-width: none;
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.record-card-source {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  max-width: none;
  margin: 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.4;
}

@media (max-width: 640px) {
  .record-card-grid dd,
  .omni-card-fields dd {
    font-size: 15px;
  }
}

/* The chat transcript: a question, the tool, an answer with its source. */
.chat {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  max-width: 560px;
  text-align: left;
}

.chat-msg {
  max-width: 88%;
  margin: 0;
  line-height: 1.5;
}

.chat-user {
  align-self: flex-end;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-card);
  background: var(--accent-soft);
}

.chat-tool {
  align-self: flex-start;
  margin: 0 0 0 28px;
  line-height: 1;
}

.chat-tool code {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--code-bg);
  color: var(--code-accent);
  font-size: var(--text-xs);
}

.chat-ai {
  display: flex;
  align-self: flex-start;
  gap: var(--space-3);
}

.chat-dot {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--line-strong);
}

.chat-body p {
  max-width: none;
  margin: 0 0 var(--space-2);
}

.chat-body .chat-source {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.4;
}

/* The code pane: one call and its answer. Dark in both themes. */
.code-pane {
  width: 100%;
  max-width: 720px;
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--code-bg);
  color: var(--code-text);
  text-align: left;
}

.code-pane-label {
  margin: 0 0 var(--space-2);
  color: var(--code-muted);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.4;
}

/* A long line scrolls inside the pane and never widens the page. */
.code-pane-block {
  margin: 0 0 var(--space-5);
  overflow-x: auto;
  font-size: var(--text-mono);
  line-height: 1.6;
  tab-size: 2;
  white-space: pre;
}

.code-pane-block code {
  padding: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
}

.code-pane .tok-key {
  color: var(--code-muted);
}

.code-pane .tok-num {
  color: var(--code-accent);
}

.code-pane-source {
  max-width: none;
  margin: 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--code-line);
  color: var(--code-muted);
  font-size: var(--text-xs);
  line-height: 1.4;
}

/* A crop: the top of a visual inside a door card. It is a picture of the
   product, so nothing in it takes a click or focus. The visual keeps its
   own color and edge all the way down and runs off the bottom of the door,
   so it has no bottom edge or bottom corners of its own. Only its last
   quarter fades, into the visual's own background, never into the page. */
.record-card.is-crop,
.chat.is-crop,
.code-pane.is-crop {
  position: relative;
  max-height: 176px;
  overflow: hidden;
  border-bottom: 0;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  pointer-events: none;
}

.record-card.is-crop::after,
.chat.is-crop::after,
.code-pane.is-crop::after {
  position: absolute;
  inset: 75% 0 0;
  background: linear-gradient(transparent, var(--surface));
  content: "";
}

/* The chat has no surface of its own: it fades into the door behind it. */
.chat.is-crop::after {
  background: linear-gradient(transparent, var(--surface-alt));
}

.code-pane.is-crop::after {
  background: linear-gradient(transparent, var(--code-bg));
}

/*
 * The stage: one surface, three tabs, the same parcel three ways. The tabs
 * are radio inputs placed before the bar and the panes, so :checked shows
 * the right pane with no script and the arrow keys move between them.
 * The parent supplies the gutter; on a phone the stage reaches 12px from
 * each edge.
 */
.stage {
  position: relative;
  max-width: var(--wide);
  min-height: 520px;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid var(--raised-line);
  border-radius: var(--radius-search);
  background: var(--surface);
  box-shadow: var(--shadow-stage);
}

.stage-bar {
  display: flex;
  justify-content: center;
  padding: var(--space-3);
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
}

.stage-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--line);
}

.stage-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.stage-tab-short {
  display: none;
}

.stage-tab:hover {
  color: var(--text);
}

#stage-search:checked ~ .stage-bar [for="stage-search"],
#stage-ask:checked ~ .stage-bar [for="stage-ask"],
#stage-api:checked ~ .stage-bar [for="stage-api"] {
  background: var(--surface);
  /* The pill alone is 1.25:1 on its track. The edge is what marks the
     chosen tab: 3:1 or more on the track in both themes. */
  box-shadow: inset 0 0 0 1.5px var(--field-line);
  color: var(--text);
  font-weight: 600;
}

/* The selected tab's underline: the one highlight on the screen. */
#stage-search:checked ~ .stage-bar [for="stage-search"]::before,
#stage-ask:checked ~ .stage-bar [for="stage-ask"]::before,
#stage-api:checked ~ .stage-bar [for="stage-api"]::before {
  position: absolute;
  right: var(--space-5);
  bottom: 9px;
  left: var(--space-5);
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--highlight);
  content: "";
}

#stage-search:focus-visible ~ .stage-bar [for="stage-search"],
#stage-ask:focus-visible ~ .stage-bar [for="stage-ask"],
#stage-api:focus-visible ~ .stage-bar [for="stage-api"] {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.stage-pane {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 444px;
  padding: var(--space-7);
  animation: stage-in var(--slow) var(--ease);
}

#stage-search:checked ~ .stage-panes [data-stage="search"],
#stage-ask:checked ~ .stage-panes [data-stage="ask"],
#stage-api:checked ~ .stage-panes [data-stage="api"] {
  display: flex;
}

.stage-idle {
  display: grid;
  justify-items: center;
  gap: var(--space-4);
  width: 100%;
}

.stage-caption {
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

/* A fade only. The pane never moves, so the search box and its button
   hold their place from the first frame: nothing to chase with a pointer. */
@keyframes stage-in {
  from {
    opacity: 0;
  }
}

@media (max-width: 899px) {
  .stage {
    min-height: 480px;
  }

  .stage-pane {
    min-height: 404px;
    padding: var(--space-6);
  }
}

@media (max-width: 640px) {
  .stage {
    margin-inline: calc(var(--space-3) - var(--gutter));
    border-radius: var(--radius-card);
  }

  .stage-pane {
    padding: var(--space-5) var(--space-4);
  }

  .stage-tab {
    padding: 0 var(--space-4);
    font-size: var(--text-xs);
  }

  /* Short labels on a phone, so the three tabs stay on one row. The tab's
     name is the radio's aria-label, the full label, at every width. */
  .stage-tab-full {
    display: none;
  }

  .stage-tab-short {
    display: inline;
  }

  #stage-search:checked ~ .stage-bar [for="stage-search"]::before,
  #stage-ask:checked ~ .stage-bar [for="stage-ask"]::before,
  #stage-api:checked ~ .stage-bar [for="stage-api"]::before {
    right: var(--space-4);
    left: var(--space-4);
  }
}

/* ----------------------------------------------------------- breadcrumbs */

/* A class, not ".breadcrumbs ol": the docs rule for bare lists outranks an
   element selector and would stack the crumbs. */
.breadcrumbs-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-5);
  padding: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 20px;
  list-style: none;
}

.breadcrumbs li {
  max-width: none;
}

.breadcrumbs li + li::before {
  margin-right: var(--space-2);
  content: "/";
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
}

.site-footer-inner {
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--space-8) var(--gutter) var(--space-6);
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-6) var(--space-5);
}

.footer-column h2 {
  margin: 0 0 var(--space-3);
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 18px;
  letter-spacing: 0;
}

.footer-column ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-column li {
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 18px;
}

.footer-column a,
.footer-button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.footer-column a:hover,
.footer-button:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
  margin: var(--space-7) 0 0;
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 18px;
}

.footer-meta .brand-mark {
  width: 20px;
  height: 20px;
}

@media (pointer: coarse) {
  .footer-column a,
  .footer-button {
    min-height: 44px;
  }
}

/* Two columns from 340px to 760px: Product and Developers on the left,
   Company and Legal on the right. The four groups flow down the left and
   the third starts the right, so neither side has a hole in it. One long
   column on a phone made the footer taller than a short page. */
@media (max-width: 760px) {
  .footer-columns {
    display: block;
    column-count: 2;
    column-gap: var(--space-5);
  }

  .footer-column {
    break-inside: avoid;
  }

  .footer-column:nth-child(odd) {
    margin-bottom: var(--space-6);
  }

  .footer-column:nth-child(3) {
    break-before: column;
  }

  .footer-column a,
  .footer-button {
    min-height: 44px;
  }
}

/* After the two-column rule, so one column wins, and only on the narrowest
   screens (under 340px), where two columns would break link text. */
@media (max-width: 339px) {
  .footer-columns {
    column-count: 1;
  }

  .footer-column:nth-child(3) {
    break-before: auto;
  }

  .footer-column:nth-child(2) {
    margin-bottom: var(--space-6);
  }
}

/* ---------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* ------------------------------------------------------------ ask prompts */

/* A short prompt a person copies and gives to their AI, on the prompts page
   and the home page. Each card shows the whole prompt as a person would say
   it, so the words are the thing to read: body size, not small print. Two
   across, one on a phone. */
.ask-prompts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ask-prompt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: none;
  min-width: 0;
  scroll-margin-top: calc(var(--header-height) + var(--space-4));
}

.ask-prompt:target {
  border-color: var(--accent);
}

.ask-prompt h3 {
  margin-bottom: var(--space-3);
}

/* The prompt keeps its blank line before the set-up sentence, and the
   button sits at the foot of the card whatever the length of the words. */
.ask-text {
  flex: 1;
  margin-bottom: var(--space-5);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* On the home page the words are one tap away, to keep that page short. */
.ask-compact h3 {
  margin-bottom: var(--space-4);
}

.ask-full {
  align-self: stretch;
  min-width: 0;
  margin-top: var(--space-2);
}

.ask-full > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--link);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

.ask-full > .ask-text {
  margin: var(--space-2) 0 0;
}

@media (max-width: 640px) {
  .ask-prompts {
    grid-template-columns: minmax(0, 1fr);
  }
}
