:root {
  --ink: #16302d;
  --muted: #61716d;
  --paper: #f7f4ec;
  --paper-deep: #eee9dc;
  --white: #fffdf8;
  --line: rgba(22, 48, 45, 0.13);
  --accent: #ee6848;
  --accent-dark: #cb4f34;
  --green: #1d7066;
  --shadow: 0 18px 55px rgba(35, 45, 42, 0.16);
  --topbar-height: 68px;
  --sidebar-width: 348px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--paper);
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
#map:focus-visible {
  outline: 3px solid rgba(238, 104, 72, 0.45);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 10000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: white;
  background: var(--ink);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: var(--topbar-height) minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
}

.topbar {
  position: relative;
  z-index: 1000;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(250px, 460px) 1fr;
  align-items: center;
  min-height: var(--topbar-height);
  padding: 0 18px 0 22px;
  background: rgba(255, 253, 248, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--white);
  background: var(--ink);
  border-radius: 11px 11px 11px 4px;
  transform: rotate(-3deg);
}

.brand-mark svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 18px;
  letter-spacing: -0.03em;
}

.brand small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  color: var(--muted);
  background: #eeece4;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: background 160ms ease, border-color 160ms ease;
}

.topbar-search:focus-within {
  background: var(--white);
  border-color: rgba(29, 112, 102, 0.4);
}

.topbar-search svg {
  width: 18px;
  height: 18px;
  margin-left: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.75;
}

.topbar-search input {
  width: 100%;
  height: 100%;
  padding: 0 44px 0 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
}

.topbar-search input::placeholder {
  color: #88938f;
}

.topbar-search kbd {
  position: absolute;
  right: 10px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #78847f;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 1px 1px rgba(20, 42, 39, 0.06);
  font-size: 11px;
}

.topbar-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.quiet-button,
.share-button {
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.quiet-button {
  background: transparent;
  border: 1px solid var(--line);
}

.share-button {
  display: flex;
  align-items: center;
  gap: 7px;
  color: white;
  background: var(--ink);
  border: 1px solid var(--ink);
}

.share-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.sidebar {
  position: relative;
  z-index: 700;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 23px 22px 0;
  background: var(--paper);
  border-right: 1px solid var(--line);
}

.sidebar-heading {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.sidebar-heading h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(29px, 2.2vw, 36px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.sidebar-heading > p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.layers-section,
.filter-section,
.places-section {
  padding-top: 18px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-title-row h2 {
  margin: 0;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-title-row > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.layer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.layer-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-height: 65px;
  padding: 9px 9px 8px;
  color: #5d6c68;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.layer-button:hover {
  transform: translateY(-1px);
  background: var(--white);
}

.layer-button.is-active {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: 0 7px 18px rgba(22, 48, 45, 0.16);
}

.layer-button[data-metric="activities"] {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  min-height: 46px;
}

.layer-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--green);
  background: #e3ebe4;
  border-radius: 7px;
}

.layer-button.is-active .layer-icon {
  color: var(--ink);
  background: #f5be6e;
}

.layer-icon svg,
.source-icon svg,
.table-metric-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.filter-section {
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.select-wrap > span {
  font-size: 12px;
  font-weight: 650;
}

.select-wrap svg {
  position: absolute;
  right: 10px;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.select-wrap select {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}

.places-section {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding-bottom: 0;
}

.text-button {
  padding: 0;
  color: var(--green);
  background: transparent;
  border: 0;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.place-list {
  min-height: 0;
  margin: 0 -8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(22, 48, 45, 0.2) transparent;
}

.place-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  border-radius: 10px;
}

.place-row:hover,
.place-row.is-active {
  background: rgba(255, 255, 255, 0.68);
}

.place-open {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.place-color {
  width: 6px;
  height: 26px;
  background: var(--place-color);
  border-radius: 99px;
}

.place-copy,
.place-value {
  min-width: 0;
}

.place-copy strong,
.place-copy small,
.place-value strong,
.place-value small {
  display: block;
}

.place-copy strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-copy small,
.place-value small {
  margin-top: 3px;
  color: #7d8a86;
  font-size: 8px;
}

.place-value {
  text-align: right;
}

.place-value strong {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.pin-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: #84908d;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.pin-button:hover,
.pin-button.is-pinned {
  color: var(--accent-dark);
  background: rgba(238, 104, 72, 0.1);
}

.pin-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.pin-button.is-pinned svg {
  fill: currentColor;
}

.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 35px 15px;
  text-align: center;
}

.no-results strong {
  font-family: Georgia, serif;
  font-size: 18px;
}

.no-results span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.sidebar-footer {
  display: grid;
  grid-template-columns: 7px 1fr auto;
  align-items: center;
  gap: 7px;
  min-height: 37px;
  color: #7c8884;
  background: var(--paper);
  border-top: 1px solid var(--line);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #5e9d72;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(94, 157, 114, 0.12);
}

.map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #dfe7e3;
}

#map {
  width: 100%;
  height: 100%;
  background: #dfe7e3;
}

.leaflet-container {
  font-family: inherit;
}

.leaflet-control-attribution {
  padding: 3px 6px !important;
  color: #71807b;
  background: rgba(255, 253, 248, 0.78) !important;
  font-size: 8px !important;
  backdrop-filter: blur(8px);
}

.leaflet-control-attribution a {
  color: #4d6962;
}

.leaflet-bar {
  overflow: hidden;
  border: 0 !important;
  border-radius: 11px !important;
  box-shadow: 0 8px 24px rgba(29, 46, 42, 0.15) !important;
}

.leaflet-bar a,
.leaflet-bar a:hover {
  width: 34px !important;
  height: 34px !important;
  color: var(--ink) !important;
  background: rgba(255, 253, 248, 0.95) !important;
  border-color: var(--line) !important;
  line-height: 32px !important;
}

.place-marker {
  background: transparent;
  border: 0;
}

.marker-bubble {
  position: relative;
  display: flex;
  align-items: center;
  width: max-content;
  max-width: 104px;
  height: 30px;
  padding: 4px 8px 4px 5px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid rgba(22, 48, 45, 0.17);
  border-radius: 9px;
  box-shadow: 0 4px 14px rgba(25, 47, 43, 0.18);
  transform: translate(1px, 5px);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.marker-bubble::before {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 12px;
  width: 10px;
  height: 10px;
  background: inherit;
  border-right: 1px solid rgba(22, 48, 45, 0.17);
  border-bottom: 1px solid rgba(22, 48, 45, 0.17);
  transform: rotate(45deg);
}

.marker-bubble::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 14px;
  width: 7px;
  height: 4px;
  background: rgba(23, 48, 45, 0.2);
  border-radius: 50%;
  filter: blur(2px);
}

.place-marker:hover .marker-bubble,
.place-marker:focus .marker-bubble {
  z-index: 2;
  box-shadow: 0 7px 19px rgba(25, 47, 43, 0.25);
  transform: translate(1px, 2px);
}

.marker-value {
  position: relative;
  z-index: 1;
  display: grid;
  flex: none;
  place-items: center;
  min-width: 34px;
  height: 20px;
  padding: 0 5px;
  color: white;
  background: var(--marker-color);
  border-radius: 6px;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.marker-name {
  position: relative;
  z-index: 1;
  overflow: hidden;
  margin-left: 6px;
  font-size: 9px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marker-bubble.is-pinned {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(238, 104, 72, 0.22), 0 7px 19px rgba(25, 47, 43, 0.2);
}

.map-metric-card,
.map-legend {
  position: absolute;
  z-index: 500;
  left: 18px;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(22, 48, 45, 0.12);
  border-radius: 12px;
  box-shadow: 0 9px 28px rgba(29, 46, 42, 0.12);
  backdrop-filter: blur(12px);
}

.map-metric-card {
  top: 17px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 2px 11px;
  min-width: 176px;
  padding: 10px 13px;
}

.metric-kicker {
  grid-column: 1 / -1;
  color: var(--accent-dark);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.map-metric-card strong {
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 500;
}

.map-metric-card > span:last-child {
  color: var(--muted);
  font-size: 8px;
}

.map-legend {
  bottom: 26px;
  width: 168px;
  padding: 10px 11px 8px;
}

.legend-heading,
.legend-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.legend-heading {
  margin-bottom: 7px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legend-heading button {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 10px;
  cursor: pointer;
}

.legend-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}

.legend-scale span {
  height: 6px;
  background: var(--legend-color);
}

.legend-scale span:first-child {
  border-radius: 99px 0 0 99px;
}

.legend-scale span:last-child {
  border-radius: 0 99px 99px 0;
}

.legend-values {
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.mobile-layers-button {
  display: none;
}

.detail-card {
  position: absolute;
  z-index: 650;
  top: 17px;
  right: 18px;
  width: min(318px, calc(100% - 36px));
  max-height: calc(100% - 102px);
  overflow-y: auto;
  background: rgba(255, 253, 248, 0.97);
  border: 1px solid rgba(22, 48, 45, 0.14);
  border-radius: 15px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 30px));
  transition: opacity 200ms ease, transform 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
  backdrop-filter: blur(16px);
}

.detail-card.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.detail-location {
  padding: 20px 20px 13px;
}

.detail-location span {
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-location h2 {
  margin: 4px 40px 0 0;
  font-family: Georgia, serif;
  font-size: 29px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.035em;
}

.detail-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  margin: 0 12px;
  padding: 15px;
  color: white;
  background: var(--detail-color);
  border-radius: 11px;
}

.detail-hero span,
.detail-hero small {
  font-size: 9px;
  font-weight: 700;
}

.detail-hero strong {
  grid-row: 1 / 3;
  grid-column: 2;
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.detail-hero small {
  margin-top: 3px;
  opacity: 0.76;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: 14px 20px 8px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.detail-metric {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 58px;
  padding: 10px;
  background: var(--white);
}

.detail-metric.is-active {
  background: #edf1e9;
}

.detail-metric[data-detail-metric="activities"] {
  grid-column: 1 / -1;
}

.detail-metric span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.detail-metric strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.activity-summary {
  margin: 12px 20px 4px;
}

.activity-summary > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.activity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.activity-tags strong {
  padding: 6px 8px;
  color: var(--green);
  background: #e5ece5;
  border-radius: 7px;
  font-size: 8px;
  font-weight: 750;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 20px 20px;
}

.detail-pin {
  height: 38px;
  color: white;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.detail-pin.is-pinned {
  color: var(--accent-dark);
  background: rgba(238, 104, 72, 0.1);
  border-color: rgba(238, 104, 72, 0.3);
}

.detail-actions a {
  color: var(--green);
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
}

.compare-tray {
  position: fixed;
  z-index: 800;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(610px, calc(100vw - var(--sidebar-width) - 36px));
  min-height: 56px;
  padding: 8px 9px 8px 15px;
  background: rgba(22, 48, 45, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 16px 42px rgba(22, 48, 45, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(80px);
  transition: opacity 180ms ease, transform 220ms ease;
  backdrop-filter: blur(14px);
}

.compare-tray.has-places {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.compare-heading {
  color: white;
}

.compare-heading span,
.compare-heading strong {
  display: block;
}

.compare-heading span {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.compare-heading strong {
  margin-top: 3px;
  color: #a5b7b2;
  font-size: 9px;
}

.compare-places {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.compare-empty {
  color: #a5b7b2;
  font-size: 10px;
}

.compare-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 130px;
  height: 33px;
  padding: 0 7px 0 10px;
  color: var(--ink);
  background: #f2efe7;
  border: 0;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.compare-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-chip svg {
  flex: none;
  width: 15px;
  height: 15px;
  padding: 2px;
  fill: none;
  stroke: #71807b;
  stroke-linecap: round;
  stroke-width: 2;
}

.compare-button {
  height: 38px;
  padding: 0 15px;
  color: var(--ink);
  background: #f5be6e;
  border: 0;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.compare-button:disabled {
  color: #6f817c;
  background: #38534f;
  cursor: not-allowed;
}

.modal {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  padding: 0;
  background: transparent;
  border: 0;
}

.modal::backdrop {
  background: rgba(13, 30, 28, 0.55);
  backdrop-filter: blur(5px);
}

.modal[open] {
  display: grid;
  place-items: center;
}

.modal-shell {
  width: min(860px, calc(100% - 34px));
  max-height: min(710px, calc(100% - 34px));
  overflow: auto;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(7, 20, 18, 0.32);
}

.sources-modal-shell {
  width: min(680px, calc(100% - 34px));
}

.modal-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 23px 25px 17px;
  background: rgba(247, 244, 236, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.modal-header .eyebrow {
  margin-bottom: 4px;
}

.modal-header h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.compare-table-wrap {
  padding: 0 25px 25px;
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.compare-table th,
.compare-table td {
  padding: 15px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.compare-table thead th {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compare-table thead th:first-child {
  width: 185px;
}

.compare-table thead strong,
.compare-table thead span {
  display: block;
}

.compare-table thead strong {
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
}

.compare-table thead span {
  margin-top: 3px;
}

.compare-table tbody th {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
}

.compare-table tbody th > span:last-child,
.compare-table tbody th small,
.compare-table td strong,
.compare-table td small {
  display: block;
}

.compare-table tbody th small,
.compare-table td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 550;
}

.table-metric-icon,
.source-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--green);
  background: #e2e9e2;
  border-radius: 8px;
}

.compare-table td {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.compare-table td.is-best strong {
  color: var(--green);
}

.compare-table td.is-best small {
  color: var(--green);
  font-weight: 750;
}

.source-intro {
  margin: 20px 25px 4px;
  color: var(--muted);
  font-size: 11px;
}

.sources-list {
  padding: 8px 25px 25px;
}

.source-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.source-row:hover strong {
  color: var(--accent-dark);
}

.source-row strong,
.source-row small {
  display: block;
}

.source-row strong {
  font-size: 11px;
}

.source-row small {
  max-width: 370px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.source-meta {
  color: var(--green);
  font-size: 8px;
  font-weight: 750;
  line-height: 1.45;
  text-align: right;
}

.toast {
  position: fixed;
  z-index: 11000;
  top: 82px;
  left: 50%;
  padding: 10px 14px;
  color: white;
  background: var(--ink);
  border-radius: 9px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -10px);
  transition: opacity 160ms ease, transform 160ms ease;
  font-size: 10px;
  font-weight: 750;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 980px) {
  :root {
    --sidebar-width: 310px;
  }

  .topbar {
    grid-template-columns: var(--sidebar-width) minmax(230px, 1fr) auto;
  }

  .topbar-actions .quiet-button {
    display: none;
  }

  .detail-card {
    width: 290px;
  }

  .marker-name {
    display: none;
  }

  .marker-bubble {
    width: max-content;
    padding-right: 5px;
  }
}

@media (max-width: 720px) {
  :root {
    --topbar-height: 60px;
  }

  .app-shell {
    display: block;
  }

  .topbar {
    position: fixed;
    inset: 0 0 auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    height: var(--topbar-height);
    padding: 0 10px 0 12px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand > span:last-child,
  .topbar-search kbd,
  .share-button span {
    display: none;
  }

  .topbar-search {
    height: 38px;
  }

  .share-button {
    display: grid;
    place-items: center;
    width: 38px;
    padding: 0;
  }

  .share-button svg {
    width: 17px;
    height: 17px;
  }

  .sidebar {
    position: fixed;
    z-index: 900;
    right: 8px;
    bottom: 8px;
    left: 8px;
    display: block;
    width: auto;
    max-height: calc(100dvh - 82px);
    padding: 18px;
    overflow-y: auto;
    border: 1px solid rgba(22, 48, 45, 0.15);
    border-radius: 16px;
    box-shadow: 0 18px 55px rgba(22, 48, 45, 0.25);
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 18px));
    transition: opacity 180ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .sidebar.is-mobile-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .sidebar-heading,
  .filter-section,
  .places-section,
  .sidebar-footer {
    display: none;
  }

  .layers-section {
    padding: 0;
  }

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

  .layer-button {
    min-height: 72px;
  }

  .map-stage {
    position: fixed;
    inset: var(--topbar-height) 0 0;
  }

  .map-metric-card {
    top: 10px;
    left: 10px;
  }

  .map-legend {
    bottom: 13px;
    left: 10px;
  }

  .mobile-layers-button {
    position: absolute;
    z-index: 700;
    right: 10px;
    bottom: 13px;
    display: flex;
    align-items: center;
    gap: 7px;
    height: 42px;
    padding: 0 14px;
    color: white;
    background: var(--ink);
    border: 0;
    border-radius: 11px;
    box-shadow: 0 9px 28px rgba(29, 46, 42, 0.22);
    font-size: 10px;
    font-weight: 800;
  }

  .mobile-layers-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
  }

  .detail-card {
    top: auto;
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
    max-height: 67%;
    transform: translateY(calc(100% + 18px));
  }

  .detail-card.is-open {
    transform: translateY(0);
  }

  .compare-tray {
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .compare-chip {
    max-width: 90px;
  }

  .compare-chip:nth-child(n + 3) {
    display: none;
  }

  .leaflet-bottom.leaflet-right {
    bottom: 55px;
  }

  .modal-shell {
    width: calc(100% - 16px);
    max-height: calc(100% - 16px);
    border-radius: 15px;
  }

  .modal-header {
    padding: 18px;
  }

  .compare-table-wrap,
  .sources-list {
    padding-right: 18px;
    padding-left: 18px;
  }

  .source-intro {
    margin-right: 18px;
    margin-left: 18px;
  }
}

@media (max-width: 430px) {
  .map-metric-card {
    min-width: 154px;
  }

  .metric-kicker,
  .map-metric-card > span:last-child {
    font-size: 7px;
  }

  .map-metric-card strong {
    font-size: 15px;
  }

  .map-legend {
    width: 145px;
  }

  .compare-heading {
    display: none;
  }

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

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