.sf-page {
  --sf-slate: #002b48;
  --sf-slate-2: #5a7a92;
  --sf-action: #495ed4;
  --sf-blue-2: #5b8dee;
  --sf-blue-1: #c1d8ff;
  --sf-yellow-2: #f9c642;
  --sf-green-2: #6fae2e;
  --sf-red-2: #f26b4e;
  --sf-grey-1: #f8f8f8;
  --sf-grey-2: #f1f1f1;
  --sf-grey-3: #e0e0e0;
  --sf-grey-5: #737373;
  --sf-softblack: #212123;
  min-height: 100vh;
  color: var(--sf-slate);
  background: #ffffff;
  font-family: Rubik, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sf-page *,
.sf-page *::before,
.sf-page *::after {
  box-sizing: border-box;
  letter-spacing: 0;
}

.sf-page a {
  color: inherit;
}

.sf-container {
  width: min(1120px, calc(100vw - 40px));
  margin: 0 auto;
}

.sf-masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--sf-grey-3);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.sf-masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 12px 0;
}

.sf-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--sf-slate);
  text-decoration: none;
}

.sf-mark {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--sf-slate);
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

.sf-wordmark,
.sf-agency {
  display: block;
}

.sf-wordmark {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
}

.sf-agency {
  margin-top: 2px;
  color: var(--sf-slate-2);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
}

.sf-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.sf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 20px;
  border: 2px solid var(--sf-action);
  border-radius: 8px;
  background: var(--sf-action);
  color: #ffffff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.sf-btn:hover,
.sf-btn:focus-visible {
  background: #0c1464;
  border-color: #0c1464;
}

.sf-btn-inverse {
  border-color: #ffffff;
  background: #ffffff;
  color: var(--sf-slate);
}

.sf-btn-inverse:hover,
.sf-btn-inverse:focus-visible {
  background: var(--sf-blue-1);
  border-color: var(--sf-blue-1);
  color: var(--sf-slate);
}

.sf-loading,
.sf-error {
  min-height: calc(100vh - 72px);
  padding: 64px 0;
}

.sf-loading {
  background: var(--sf-grey-1);
}

.sf-loading-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  align-items: end;
  gap: 48px;
}

.sf-loading-copy h1,
.sf-error h2 {
  max-width: 720px;
  margin: 0;
  color: var(--sf-slate);
  font-size: 56px;
  font-weight: 300;
  line-height: 1;
}

.sf-loading-copy p,
.sf-error p {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--sf-slate-2);
  font-size: 20px;
  line-height: 1.45;
}

.sf-loading-art {
  padding: 24px;
  border: 1px solid var(--sf-grey-3);
  border-radius: 8px;
  background: #ffffff;
}

.sf-loading-art img {
  display: block;
  width: 100%;
  height: auto;
}

.sf-error .sf-btn {
  margin-top: 24px;
}

.sf-hero {
  padding: 72px 0 52px;
  background: var(--sf-slate);
  color: #ffffff;
}

.sf-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 56px;
  align-items: end;
}

.sf-eyebrow,
.sf-section-tag {
  margin-bottom: 12px;
  color: var(--sf-yellow-2);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}

.sf-section-tag {
  color: var(--sf-action);
}

.sf-hero-title {
  max-width: 790px;
  margin: 0;
  color: #ffffff;
  font-size: 64px;
  font-weight: 300;
  line-height: 1.02;
}

.sf-hero-dek {
  max-width: 760px;
  margin: 22px 0 28px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 22px;
  line-height: 1.42;
}

.sf-hero-measure {
  min-height: 252px;
  padding: 24px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--sf-slate);
}

.sf-measure-label,
.sf-stat-label {
  color: var(--sf-slate-2);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}

.sf-hero-measure span {
  display: block;
  margin-top: 18px;
  color: var(--sf-action);
  font-size: 76px;
  font-weight: 300;
  line-height: 0.95;
}

.sf-hero-measure p {
  margin: 16px 0 0;
  color: var(--sf-slate);
  font-size: 18px;
  line-height: 1.35;
}

.sf-band {
  background: var(--sf-grey-1);
  border-bottom: 1px solid var(--sf-grey-3);
}

.sf-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--sf-grey-3);
}

.sf-stat {
  min-width: 0;
  min-height: 154px;
  padding: 24px;
  background: #ffffff;
}

.sf-stat-value {
  margin-top: 16px;
  color: var(--sf-slate);
  font-size: 42px;
  font-weight: 300;
  line-height: 1;
}

.sf-stat-value.is-date {
  font-size: 28px;
  line-height: 1.1;
}

.sf-section {
  padding: 72px 0;
  background: #ffffff;
}

.sf-section-muted {
  background: var(--sf-grey-1);
}

.sf-section-head {
  max-width: 780px;
  margin-bottom: 24px;
}

.sf-section-head h2 {
  margin: 0;
  color: var(--sf-slate);
  font-size: 42px;
  font-weight: 400;
  line-height: 1.12;
}

.sf-section-head p {
  margin: 16px 0 0;
  color: var(--sf-slate-2);
  font-size: 19px;
  line-height: 1.45;
}

.sf-chart-shell,
.sf-map {
  width: 100%;
  border: none;
  border-radius: 0;
  background: #f4f6f8;
}

/* Single-hue monochrome basemap: grayscale the CARTO tiles, then tint them toward the
   SF.gov action blue so the map reads as one quiet surface under the data. */
.sf-map .leaflet-tile-pane {
  filter: grayscale(1) sepia(1) saturate(1.4) hue-rotate(170deg) brightness(1) contrast(1);
}

.sf-chart-shell {
  height: 430px;
  padding: 12px;
}

.sf-chart-shell.is-performance {
  height: 360px;
}

.sf-chart-shell.is-short {
  height: 340px;
}

.sf-plot {
  width: 100%;
  height: 100%;
}

.sf-notes,
.sf-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: var(--sf-slate-2);
  font-size: 14px;
  font-weight: 500;
}

.sf-notes span,
.sf-map-legend span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--sf-grey-3);
  border-radius: 8px;
  background: #ffffff;
}

.sf-toggle-row {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  border: 1px solid var(--sf-grey-3);
  border-radius: 8px;
  background: #ffffff;
}

.sf-toggle-row button {
  min-height: 38px;
  padding: 8px 16px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--sf-slate);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.sf-toggle-row button.is-active {
  background: var(--sf-slate);
  color: #ffffff;
}

.sf-map {
  height: min(620px, 68vh);
  min-height: 420px;
  overflow: hidden;
}

.sf-page .leaflet-container {
  font-family: Rubik, ui-sans-serif, system-ui, sans-serif;
}

.sf-page .leaflet-control-zoom {
  border: 1px solid var(--sf-grey-3);
}

.sf-page .leaflet-bar a,
.sf-page .leaflet-bar a:hover {
  border-bottom: 1px solid var(--sf-grey-3);
  background: #ffffff;
  color: var(--sf-slate);
}

.sf-page .leaflet-tooltip.sf-tooltip {
  border: 1px solid var(--sf-grey-3);
  border-radius: 8px;
  color: var(--sf-slate);
  font-size: 13px;
  box-shadow: 0 8px 20px rgba(0, 43, 72, 0.14);
}

.sf-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px;
}

.sf-ranked-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sf-ranked-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 66px;
  padding: 14px;
  border: 1px solid var(--sf-grey-3);
  border-radius: 8px;
  background: #ffffff;
}

.sf-rank {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--sf-blue-1);
  color: var(--sf-slate);
  font-weight: 600;
}

.sf-list-title {
  min-width: 0;
  color: var(--sf-slate);
  font-weight: 600;
  line-height: 1.2;
}

.sf-list-meta {
  margin-top: 4px;
  color: var(--sf-slate-2);
  font-size: 14px;
  line-height: 1.3;
}

.sf-list-value {
  color: var(--sf-action);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
}

.sf-ranked-list li.sf-empty {
  display: block;
  padding: 16px;
  border-style: dashed;
  color: var(--sf-slate-2);
}

.sf-footer {
  padding: 64px 0;
  background: var(--sf-slate);
  color: #ffffff;
}

.sf-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
  gap: 56px;
}

.sf-footer h2 {
  margin: 0 0 16px;
  color: #ffffff;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.15;
}

.sf-footer p,
.sf-footer li {
  color: rgba(255, 255, 255, 0.86);
  font-size: 17px;
  line-height: 1.5;
}

.sf-footer ul {
  margin: 18px 0 0;
  padding-left: 18px;
}

.sf-source-list {
  display: grid;
  gap: 10px;
}

.sf-source-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  color: #ffffff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sf-source-list a:hover,
.sf-source-list a:focus-visible {
  border-color: var(--sf-yellow-2);
  color: var(--sf-yellow-2);
}

@media (max-width: 920px) {
  .sf-loading-shell,
  .sf-hero-grid,
  .sf-two-column,
  .sf-footer-grid {
    grid-template-columns: 1fr;
  }

  .sf-hero-measure {
    min-height: 0;
  }

  .sf-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .sf-container {
    width: min(100vw - 24px, 1120px);
  }

  .sf-masthead-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .sf-nav {
    width: 100%;
    justify-content: space-between;
  }

  .sf-loading,
  .sf-error,
  .sf-hero,
  .sf-section,
  .sf-footer {
    padding-top: 44px;
    padding-bottom: 44px;
  }

  .sf-loading-copy h1,
  .sf-hero-title {
    font-size: 42px;
    line-height: 1.06;
  }

  .sf-error h2,
  .sf-section-head h2 {
    font-size: 34px;
    line-height: 1.12;
  }

  .sf-hero-dek,
  .sf-section-head p {
    font-size: 17px;
  }

  .sf-hero-measure span {
    font-size: 58px;
  }

  .sf-stat-grid {
    grid-template-columns: 1fr;
  }

  .sf-stat {
    min-height: 124px;
  }

  .sf-chart-shell {
    height: 360px;
    padding: 8px;
  }

  .sf-chart-shell.is-performance,
  .sf-chart-shell.is-short {
    height: 320px;
  }

  .sf-map {
    min-height: 360px;
  }

  .sf-ranked-list li {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .sf-list-value {
    grid-column: 2;
  }
}
