:root {
  --bg-page: #f4f7f8;
  --bg-surface: rgba(255, 255, 255, 0.94);
  --bg-surface-solid: #ffffff;
  --bg-subtle: #e9eff2;
  --bg-hover: #eff5f7;
  --border: #d3dee4;
  --border-strong: #b1c2cb;

  --ink: #0f1e24;
  --ink-secondary: #30454f;
  --ink-muted: #4a606a;

  --accent: #0e5a4c;
  --accent-hover: #0a463b;
  --accent-soft: #e3f1ed;

  --marine: #1e5a8a;
  --marine-soft: #e6f0f8;

  --ochre: #a45b10;
  --ochre-soft: #faf0e2;

  --vermilion: #b5372a;
  --vermilion-soft: #fbedeb;

  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* 4 disciplined body scale steps for data-dense dashboard */
  --text-h2: 1.375rem;
  --text-body: 0.9375rem;
  --text-sm: 0.875rem;
  --text-xs: 0.8125rem;

  --radius-sm: 4px;
  --radius-md: 6px;
  --container-max: 1280px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--bg-page);
  overflow-x: clip;
  position: relative;
}

/* Subtle realistic transparent Seattle skyline watermark anchored across the page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("./assets/seattle-skyline-bg.jpg");
  background-size: cover;
  background-position: right bottom;
  background-repeat: no-repeat;
  opacity: 0.13;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.75) 55%, rgba(0, 0, 0, 1) 100%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.75) 55%, rgba(0, 0, 0, 1) 100%);
}

code {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.92em;
  background-color: var(--bg-subtle);
  padding: 0.08em 0.32em;
  border-radius: 3px;
  color: var(--ink);
}

.num,
.kpi-value,
.tabular {
  font-variant-numeric: tabular-nums;
}

/* High-visibility directional percentage highlights vs historical norms */
.delta-pos {
  color: #0d6e4f;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.delta-neg {
  color: #c22e23;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.delta-sub {
  display: block;
  font-size: var(--text-xs);
  margin-top: 0.1rem;
}

.tooltip-delta-pos {
  color: #63e6ae;
  font-weight: 700;
}

.tooltip-delta-neg {
  color: #ff8c82;
  font-weight: 700;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg-surface-solid);
  padding: 0.75rem 1rem;
  z-index: 200;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 180ms var(--ease-out), border-color 180ms var(--ease-out);
}

.site-header.scrolled {
  background-color: rgba(244, 247, 248, 0.93);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
  min-width: 0;
}

.brand-mark {
  color: var(--ink);
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.main-nav a {
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-secondary);
  white-space: nowrap;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  padding: 0.625rem 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 140ms var(--ease-out);
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: progress;
}

.btn-secondary {
  background-color: var(--bg-surface-solid);
  color: var(--ink);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background-color: var(--bg-subtle);
}

.is-loading .refresh-icon {
  animation: spin 800ms linear infinite;
}

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

/* Overview opening band with realistic transparent Seattle skyline bleeding to y=0 */
.overview-section {
  position: relative;
  margin-top: -64px;
  padding: 5.5rem 0 2.25rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.seattle-skyline-layer {
  position: absolute;
  inset: 0 0 auto 0;
  height: 430px;
  background-image:
    linear-gradient(100deg, rgba(244, 247, 248, 0.92) 0%, rgba(244, 247, 248, 0.78) 44%, rgba(244, 247, 248, 0.22) 78%, rgba(244, 247, 248, 0.08) 100%),
    linear-gradient(180deg, rgba(244, 247, 248, 0.28) 0%, rgba(244, 247, 248, 0.12) 48%, rgba(244, 247, 248, 0.92) 86%, var(--bg-page) 100%),
    url("./assets/seattle-skyline-bg.jpg");
  background-size: cover;
  background-position: right 62%;
  background-repeat: no-repeat;
  opacity: 0.95;
  pointer-events: none;
  z-index: 0;
}

.overview-content {
  position: relative;
  z-index: 1;
}

.overview-head {
  margin-bottom: 1.75rem;
}

.overview-title-wrap h1 {
  margin: 0 0 0.55rem;
  max-width: 24ch;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.4vw, 2.85rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.overview-subtitle {
  margin: 0;
  max-width: 64ch;
  font-size: var(--text-body);
  color: var(--ink-secondary);
}

.data-freshness {
  color: var(--ink-muted);
  font-weight: 500;
}

/* KPI ledger: architectural hairline columns with subtle sparklines */
.kpi-ledger {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background-color: var(--bg-surface);
  backdrop-filter: blur(8px);
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.kpi-cell {
  padding: 1.2rem 1.3rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.kpi-cell:last-child {
  border-right: none;
}

.kpi-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.kpi-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-muted);
}

.kpi-spark {
  flex-shrink: 0;
  width: 58px;
  height: 20px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
}

.kpi-detail {
  margin: 0.15rem 0 0;
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--ink-muted);
}

/* Top metrics: Typical permit timelines by building type */
.typology-band {
  margin-top: 1.5rem;
  background-color: var(--bg-surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
}

.typology-band-head {
  padding: 1.15rem 1.35rem 0.95rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
}

.typology-band-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.typology-band-sub {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.typology-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.typology-col {
  padding: 1.2rem 1.35rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

.typology-col:last-child {
  border-right: none;
}

.typology-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.typology-icon-box {
  width: 64px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.typology-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.typology-sample {
  font-size: var(--text-xs);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.typology-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.typology-row {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.typology-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: var(--text-xs);
}

.typology-stage-name {
  color: var(--ink-secondary);
  font-weight: 500;
}

.typology-stage-val {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.typology-bar-track {
  height: 6px;
  background-color: var(--bg-subtle);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.typology-bar-mean {
  position: absolute;
  inset: 0 auto 0 0;
  opacity: 0.28;
  border-radius: 2px;
}

.typology-bar-med {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 2px;
}

.typology-note {
  margin: 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--bg-subtle);
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* Data sections */
.data-section {
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.section-header-text {
  max-width: 62ch;
}

.section-header h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--ink);
}

.section-desc {
  margin: 0;
  font-size: var(--text-body);
  color: var(--ink-muted);
}

/* Dataset definitions strip (Building / Land use / Trade) */
.dataset-glossary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

.glossary-item {
  appearance: none;
  border: none;
  border-right: 1px solid var(--border);
  border-top: 2px solid transparent;
  background: transparent;
  padding: 0.85rem 1.05rem;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

.glossary-item:last-child {
  border-right: none;
}

.glossary-item:hover {
  background-color: var(--bg-hover);
}

.glossary-item.active {
  background-color: var(--accent-soft);
  border-top-color: var(--accent);
}

.glossary-term {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink);
}

.glossary-def {
  font-size: var(--text-xs);
  font-style: italic;
  font-weight: 400;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* Permit lifecycle graphic strip */
.lifecycle-strip {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.15rem;
}

/* Editorial Seattle architecture photo strip */
.editorial-photo-strip {
  margin: 0 0 1.5rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.editorial-photo-frame {
  width: 100%;
  aspect-ratio: 21 / 6;
  overflow: hidden;
  background-color: var(--bg-subtle);
}

.editorial-photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 46%;
}

.editorial-photo-caption {
  padding: 0.7rem 1.15rem;
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--ink-muted);
  border-top: 1px solid var(--border);
}

/* Non-button selection controls */
.control-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.segmented {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.segmented button {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 0.42rem 0.78rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button[aria-selected="true"] {
  background-color: var(--bg-surface-solid);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 30, 36, 0.08);
}

.segmented-sm button {
  font-size: var(--text-xs);
  padding: 0.34rem 0.65rem;
}

.select-control,
.search-input {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--ink);
  background-color: var(--bg-surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.48rem 0.72rem;
  line-height: 1.3;
  transition: border-color 150ms var(--ease-out);
}

.select-control:focus,
.search-input:focus {
  outline: 2px solid rgba(14, 90, 76, 0.25);
  border-color: var(--accent);
}

.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--text-sm);
  color: var(--ink-secondary);
  cursor: pointer;
  user-select: none;
}

.toggle-inline input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Primary chart stage */
.chart-stage {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 1.25rem 1.35rem 1rem;
  min-width: 0;
  max-width: 100%;
}

.chart-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--bg-subtle);
}

.chart-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.15rem;
  font-size: var(--text-xs);
  color: var(--ink-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.legend-note {
  color: var(--ink-muted);
  font-size: var(--text-xs);
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.swatch-line {
  display: inline-block;
  width: 16px;
  height: 2px;
  flex-shrink: 0;
}

.swatch-dashed {
  display: inline-block;
  width: 18px;
  height: 0;
  border-top: 2px dashed var(--ink-muted);
  flex-shrink: 0;
}

.swatch-evergreen { background-color: var(--accent); }
.swatch-marine { background-color: var(--marine); }
.swatch-ochre { background-color: var(--ochre); }
.swatch-vermilion { background-color: var(--vermilion); }
.swatch-ink { background-color: var(--ink); }

.chart-summary-stat {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.chart-canvas-wrap {
  width: 100%;
  overflow-x: auto;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-axis-text {
  font-family: var(--font-body);
  font-size: 13px;
  fill: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.chart-grid-line {
  stroke: var(--bg-subtle);
  stroke-width: 1;
}

.chart-bar {
  cursor: pointer;
  transition: opacity 140ms var(--ease-out);
}

.chart-bar:hover {
  opacity: 0.82;
}

/* Asymmetric split grids */
.split-grid {
  display: grid;
  gap: 1.5rem;
}

.section-subgrid {
  margin-top: 1.5rem;
}

.split-55-45 { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.split-58-42 { grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr); }
.split-56-44 { grid-template-columns: minmax(0, 1.27fr) minmax(0, 1fr); }
.split-52-48 { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }

.panel-block {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 1.35rem;
  min-width: 0;
  max-width: 100%;
}

.projects-ledger,
.map-panel {
  min-width: 0;
  max-width: 100%;
}

.block-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.block-heading {
  margin: 0 0 0.25rem;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--ink);
}

.sub-heading {
  margin: 0 0 0.3rem;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--ink);
}

.block-desc {
  margin: 0 0 1rem;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table th {
  text-align: left;
  font-weight: 600;
  color: var(--ink-muted);
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border-strong);
  background-color: var(--bg-page);
  white-space: nowrap;
}

.data-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--bg-subtle);
  color: var(--ink);
  vertical-align: top;
}

.data-table th.num,
.data-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.compact-table th,
.compact-table td {
  padding: 0.55rem 0.6rem;
}

.projects-table tbody tr {
  cursor: pointer;
  transition: background-color 140ms var(--ease-out);
}

.projects-table tbody tr:hover {
  background-color: var(--bg-hover);
}

.cell-primary {
  font-weight: 600;
  color: var(--ink);
}

.cell-secondary {
  display: block;
  font-size: var(--text-xs);
  color: var(--ink-muted);
  margin-top: 0.15rem;
}

/* Semantic table status cells only */
.status-cell {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 3px;
  white-space: nowrap;
}

.status-issued {
  background-color: var(--accent-soft);
  color: var(--accent);
}

.status-review {
  background-color: var(--ochre-soft);
  color: var(--ochre);
}

.status-ready {
  background-color: var(--marine-soft);
  color: var(--marine);
}

/* Horizontal bar lists with italicized lighter definitions */
.bar-list {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.bar-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: var(--text-sm);
}

.bar-row-label {
  font-weight: 600;
  color: var(--ink);
}

.bar-row-meta {
  font-size: var(--text-xs);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bar-row-def {
  margin: 0.1rem 0 0;
  font-size: var(--text-xs);
  font-style: italic;
  font-weight: 400;
  color: var(--ink-muted);
  line-height: 1.4;
}

.bar-track {
  width: 100%;
  height: 7px;
  background-color: var(--bg-subtle);
  border-radius: 2px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background-color: var(--accent);
  border-radius: 2px;
  transition: width 320ms var(--ease-out);
}

.bar-fill-marine {
  background-color: var(--marine);
}

/* Range chart & multifamily journey */
.range-chart-wrap {
  margin-top: 0.5rem;
}

.journey-stack {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  margin-top: 0.5rem;
}

.journey-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.journey-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.journey-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

.journey-nums {
  font-size: var(--text-xs);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.journey-bar-bg {
  position: relative;
  height: 22px;
  background-color: var(--bg-subtle);
  border-radius: 2px;
  overflow: hidden;
}

.journey-bar-mean {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  opacity: 0.28;
}

.journey-bar-median {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
}

.journey-total-box {
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.journey-total-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

.journey-total-val {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.methodology-footnote {
  margin: 0.9rem 0 0;
  font-size: var(--text-xs);
  color: var(--ink-muted);
  line-height: 1.45;
}

/* Status funnel grid */
.funnel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.funnel-cell {
  padding: 1rem 1.15rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  background: transparent;
  text-align: left;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: background-color 140ms var(--ease-out);
}

.funnel-cell:hover {
  background-color: var(--bg-hover);
}

.funnel-cell.active {
  background-color: var(--accent-soft);
}

.funnel-stage {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

.funnel-units {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.funnel-meta {
  font-size: var(--text-xs);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.funnel-bar {
  margin-top: 0.25rem;
  height: 4px;
  background-color: var(--bg-subtle);
  border-radius: 2px;
  overflow: hidden;
}

.funnel-bar-fill {
  height: 100%;
  border-radius: 2px;
}

/* Projects ledger */
.projects-ledger {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 1.35rem;
}

.projects-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.table-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.table-filters .search-input {
  min-width: 240px;
}

/* Map and ZIP panel */
.map-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.map-legend-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: var(--text-xs);
  color: var(--ink-secondary);
}

.map-stage {
  position: relative;
  width: 100%;
  background-color: #dce9ef;
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.map-svg {
  display: block;
  width: 100%;
  height: auto;
}

.map-dot {
  cursor: pointer;
  transition: opacity 150ms var(--ease-out), stroke-width 150ms var(--ease-out);
}

.map-dot:hover {
  stroke: var(--ink);
  stroke-width: 2;
}

.zip-panel {
  display: flex;
  flex-direction: column;
}

.zip-list {
  display: flex;
  flex-direction: column;
  max-height: 540px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
}

.zip-row {
  appearance: none;
  border: none;
  border-bottom: 1px solid var(--bg-subtle);
  background: transparent;
  padding: 0.62rem 0.5rem;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: background-color 140ms var(--ease-out);
}

.zip-row:hover {
  background-color: var(--bg-hover);
}

.zip-row.selected {
  background-color: var(--accent-soft);
}

.zip-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.zip-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

.zip-hood {
  font-weight: 400;
  color: var(--ink-muted);
  margin-left: 0.35rem;
}

.zip-units {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.zip-sub {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* Sources & API section */
.sources-section {
  border-bottom: none;
}

.catalog-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.catalog-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--bg-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.catalog-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.catalog-title:hover {
  color: var(--accent);
  text-decoration: underline;
}

.catalog-desc {
  margin: 0.2rem 0 0;
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.catalog-meta {
  text-align: right;
  flex-shrink: 0;
  font-size: var(--text-xs);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.api-controls-box {
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}

.token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}

.token-row .search-input {
  flex: 1 1 200px;
}

.query-status {
  font-size: var(--text-xs);
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
  min-height: 1.2em;
}

.methodology-list {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.method-item {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bg-subtle);
}

.method-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.method-item p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ink-secondary);
  max-width: 65ch;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background-color: var(--bg-surface);
  padding: 1.5rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-body);
  color: var(--ink);
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: var(--text-xs);
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-note {
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

/* Project inspection drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 30, 36, 0.35);
  z-index: 90;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 100vw);
  background-color: var(--bg-surface-solid);
  border-left: 1px solid var(--border-strong);
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(15, 30, 36, 0.14);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.drawer-permit-num {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.2rem;
}

.drawer-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.drawer-close {
  appearance: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

.drawer-close:hover {
  background-color: var(--border);
}

.drawer-body {
  padding: 1.35rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.drawer-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.drawer-kv-label {
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.drawer-kv-value {
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.drawer-desc {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ink-secondary);
  line-height: 1.55;
}

/* Floating chart tooltip */
.chart-tooltip {
  position: fixed;
  z-index: 120;
  pointer-events: none;
  background-color: var(--ink);
  color: #ffffff;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  line-height: 1.45;
  max-width: 280px;
  box-shadow: 0 8px 24px rgba(15, 30, 36, 0.24);
  font-variant-numeric: tabular-nums;
}

.tooltip-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
  font-size: var(--text-sm);
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.tooltip-muted {
  color: #b7c8d0;
}

/* Responsive */
@media (max-width: 1080px) {
  .main-nav {
    display: none;
  }

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

  .kpi-cell:nth-child(2) {
    border-right: none;
  }

  .kpi-cell:nth-child(1),
  .kpi-cell:nth-child(2) {
    border-bottom: 1px solid var(--border);
  }

  .typology-grid,
  .dataset-glossary {
    grid-template-columns: minmax(0, 1fr);
  }

  .typology-col,
  .glossary-item {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .typology-col:last-child,
  .glossary-item:last-child {
    border-bottom: none;
  }

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

  .split-55-45,
  .split-58-42,
  .split-56-44,
  .split-52-48 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .main-nav {
    display: none;
  }

  .header-inner {
    height: 58px;
    gap: 0.5rem;
  }

  .brand {
    flex-shrink: 1;
  }

  .brand-name {
    font-size: 0.92rem;
    white-space: normal;
    line-height: 1.15;
  }

  .header-actions .btn-primary {
    padding: 0.48rem 0.65rem;
    font-size: var(--text-xs);
  }

  .container {
    padding: 0 1rem;
  }

  .overview-section {
    margin-top: -58px;
    padding: 4.5rem 0 1.5rem;
  }

  .seattle-skyline-layer {
    height: 300px;
    background-position: 82% 72%;
    opacity: 0.38;
  }

  .data-section {
    padding: 2rem 0;
  }

  .kpi-ledger {
    grid-template-columns: minmax(0, 1fr);
  }

  .kpi-cell {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.1rem;
  }

  .kpi-cell:last-child {
    border-bottom: none;
  }

  .editorial-photo-frame {
    aspect-ratio: 16 / 9;
  }

  .funnel-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .funnel-cell {
    border-right: none;
  }

  .table-filters .search-input {
    min-width: 0;
    width: 100%;
  }

  .token-row .select-control,
  .table-filters .select-control {
    max-width: 100%;
    width: 100%;
  }

  .chart-stage,
  .panel-block,
  .projects-ledger,
  .map-panel,
  .lifecycle-strip {
    padding: 1rem;
  }

  .segmented {
    max-width: 100%;
    overflow-x: auto;
  }
}

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