/* RTP Directory — map + directory UI */

:root {
  --paper: #f2eee4;
  --panel: rgba(251, 249, 243, 0.9);
  --panel-solid: #fbf9f3;
  --card: rgba(255, 255, 255, 0.72);
  --card-hover: #ffffff;
  --ink: #10231c;
  --ink-2: #44554d;
  --ink-3: #75847c;
  --line: rgba(16, 35, 28, 0.09);
  --line-2: rgba(16, 35, 28, 0.16);
  --accent: #e2552c;
  --accent-ink: #ffffff;
  --accent-soft: rgba(226, 85, 44, 0.12);
  --pine: #0f5b4b;
  --glow: rgba(226, 85, 44, 0.35);
  --shadow-sm: 0 1px 2px rgba(16, 35, 28, 0.06), 0 2px 6px rgba(16, 35, 28, 0.05);
  --shadow-lg: 0 1px 2px rgba(16, 35, 28, 0.05), 0 24px 60px -18px rgba(16, 35, 28, 0.32);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --panel-w: 420px;
  --detail-w: 400px;
  --gap: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #0a1512;
  --panel: rgba(13, 25, 21, 0.86);
  --panel-solid: #0f1d19;
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.08);
  --ink: #e9f1ec;
  --ink-2: #b1c0b8;
  --ink-3: #7f9189;
  --line: rgba(233, 241, 236, 0.08);
  --line-2: rgba(233, 241, 236, 0.16);
  --accent: #ff7a4d;
  --accent-ink: #1b0e08;
  --accent-soft: rgba(255, 122, 77, 0.16);
  --pine: #7fd1b9;
  --glow: rgba(255, 122, 77, 0.4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.3), 0 30px 70px -20px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.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;
}

/* ------------------------------------------------------------------ Map */

#map {
  position: fixed;
  inset: 0;
  background: var(--paper);
}

#map::after {
  /* soft vignette so floating panels read against the map */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 70% 45%, transparent 55%, rgba(16, 35, 28, 0.1) 100%),
    linear-gradient(90deg, rgba(242, 238, 228, 0.55), transparent 32%);
  z-index: 1;
}

[data-theme="dark"] #map::after {
  background:
    radial-gradient(120% 90% at 70% 45%, transparent 50%, rgba(0, 0, 0, 0.45) 100%),
    linear-gradient(90deg, rgba(10, 21, 18, 0.6), transparent 32%);
}

.maplibregl-canvas {
  outline: none;
}

.maplibregl-ctrl-attrib {
  font-size: 11px;
  background: transparent !important;
}

.maplibregl-ctrl-attrib-inner,
.maplibregl-ctrl-attrib a {
  color: var(--ink-3) !important;
}

.maplibregl-ctrl-bottom-right {
  right: 8px;
  bottom: 4px;
}

.map-tip {
  pointer-events: none;
  position: absolute;
  z-index: 5;
  transform: translate(-50%, calc(-100% - 14px));
  padding: 7px 11px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.map-tip.show {
  opacity: 1;
}

.map-tip small {
  display: block;
  font-weight: 500;
  opacity: 0.7;
  font-size: 11.5px;
}

.pulse {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 0 0 0 var(--glow), 0 6px 16px rgba(0, 0, 0, 0.25);
  animation: pulse 2s infinite var(--ease);
}

.pulse.ring {
  width: 46px;
  height: 46px;
  background: transparent;
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 0 var(--glow);
  pointer-events: none;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 var(--glow), 0 6px 16px rgba(0, 0, 0, 0.25);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(226, 85, 44, 0), 0 6px 16px rgba(0, 0, 0, 0.25);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(226, 85, 44, 0), 0 6px 16px rgba(0, 0, 0, 0.25);
  }
}

/* --------------------------------------------------------------- Panels */

.glass {
  background: var(--panel);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.panel {
  position: fixed;
  z-index: 10;
  top: var(--gap);
  left: var(--gap);
  bottom: var(--gap);
  width: var(--panel-w);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.panel-head {
  padding: 20px 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.wordmark svg {
  width: 30px;
  height: 30px;
}

.wordmark span {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.wordmark em {
  font-style: normal;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink-3);
  letter-spacing: 0;
}

.head-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--ink-2);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s var(--ease);
}

.icon-btn:hover {
  background: var(--line);
  color: var(--ink);
}

.icon-btn:active {
  transform: scale(0.94);
}

.hero {
  margin: 18px 0 16px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pine);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1.5px;
  background: currentColor;
  opacity: 0.7;
}

.hero h1 {
  margin: 8px 0 8px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 31px;
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 96;
}

.hero h1 i {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
}

.stats b {
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.search .icon {
  position: absolute;
  left: 14px;
  color: var(--ink-3);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 42px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--card);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.search input::placeholder {
  color: var(--ink-3);
}

.search input:focus {
  border-color: var(--accent);
  background: var(--card-hover);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.search input::-webkit-search-cancel-button {
  display: none;
}

.search kbd,
.search .clear {
  position: absolute;
  right: 10px;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-3);
  background: var(--panel-solid);
}

.search .clear {
  display: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  place-items: center;
  color: var(--ink-3);
}

.search.has-value .clear {
  display: grid;
}

.search.has-value kbd {
  display: none;
}

.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 20px 12px;
  margin: 0 -20px;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 28px), transparent);
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--card);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-2);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s var(--ease);
}

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

.chip:active {
  transform: scale(0.97);
}

.chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c, var(--ink-3));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c, var(--ink-3)) 22%, transparent);
}

.chip .n {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.chip[aria-pressed="true"] .n {
  color: color-mix(in srgb, var(--paper) 70%, transparent);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 20px 10px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
}

.toolbar .count b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.toggles {
  display: flex;
  gap: 4px;
  align-items: center;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-2);
  transition: background 0.15s ease, color 0.15s ease;
}

.toggle .icon {
  width: 15px;
  height: 15px;
}

.toggle:hover {
  background: var(--line);
}

.toggle[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.sort {
  appearance: none;
  -webkit-appearance: none;
  field-sizing: content;
  height: 28px;
  padding: 0 24px 0 10px;
  border-radius: 9px;
  border: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%2375847c' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 9px center;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-2);
  cursor: pointer;
}

.sort:hover {
  background-color: var(--line);
}

/* --------------------------------------------------------------- Results */

.results {
  list-style: none;
  margin: 0;
  padding: 4px 12px 16px;
  overflow-y: auto;
  flex: 1;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.results::-webkit-scrollbar {
  width: 8px;
}

.results::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.group-label {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 10px 0 4px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: color-mix(in srgb, var(--panel-solid) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}

.group-label:first-child {
  margin-top: 2px;
}

.card {
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  margin: 2px 0;
  padding: 10px 10px 10px 10px;
  border-radius: var(--radius-lg);
  text-align: left;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.18s var(--ease), box-shadow 0.18s ease;
  animation: rise 0.35s var(--ease) both;
}

.card:hover,
.card.is-hover {
  background: var(--card-hover);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.card[aria-current="true"] {
  background: var(--card-hover);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.card::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 3px;
  background: var(--c);
  opacity: 0;
  transform: scaleY(0.4);
  transition: opacity 0.18s ease, transform 0.18s var(--ease);
}

.card:hover::before,
.card.is-hover::before,
.card[aria-current="true"]::before {
  opacity: 1;
  transform: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.logo {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 1px 1px rgba(16, 35, 28, 0.04);
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.logo .mono {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: #fff;
  background:
    radial-gradient(120% 120% at 20% 10%, rgba(255, 255, 255, 0.35), transparent 50%),
    var(--c);
}

.logo.has-img .mono {
  display: none;
}

.card-body {
  min-width: 0;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 14.5px;
  font-weight: 620;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title .title-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-verified {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--pine);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta .cat {
  color: var(--ink-2);
  font-weight: 550;
}

.card-meta .sep {
  opacity: 0.5;
}

.card-links {
  display: flex;
  gap: 2px;
  margin-top: 6px;
  color: var(--ink-3);
}

.card-links .icon {
  width: 14px;
  height: 14px;
}

.card-links span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--line);
}

.card-arrow {
  color: var(--ink-3);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.18s var(--ease);
}

.card:hover .card-arrow,
.card[aria-current="true"] .card-arrow {
  opacity: 1;
  transform: none;
}

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-3);
}

.empty h3 {
  margin: 12px 0 4px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  color: var(--ink);
}

.empty button {
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 13px;
}

/* ---------------------------------------------------------------- Detail */

.detail {
  position: fixed;
  z-index: 11;
  top: var(--gap);
  right: var(--gap);
  bottom: var(--gap);
  width: var(--detail-w);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  overflow: hidden;
  transform: translateX(calc(100% + 40px));
  opacity: 0;
  transition: transform 0.45s var(--ease), opacity 0.3s ease;
  pointer-events: none;
}

.detail.open {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

.detail-scroll {
  overflow-y: auto;
  flex: 1;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.cover {
  position: relative;
  height: 128px;
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(255, 255, 255, 0.35), transparent 55%),
    radial-gradient(70% 120% at 0% 100%, rgba(0, 0, 0, 0.18), transparent 60%),
    linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #10231c));
  overflow: hidden;
}

.cover::before {
  /* contour-line texture — a nod to the Park's rolling woods */
  content: "";
  position: absolute;
  inset: -40%;
  background: repeating-radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 16px);
  opacity: 0.6;
}

.cover-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
}

.cover-actions .icon-btn {
  color: #fff;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cover-actions .icon-btn:hover {
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
}

.detail-head {
  position: relative;
  padding: 0 24px;
  margin-top: -38px;
}

.detail-head .logo {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  border: 4px solid var(--panel-solid);
  box-shadow: var(--shadow-sm);
}

.detail-head .logo img {
  padding: 9px;
}

.detail-head .logo .mono {
  font-size: 28px;
}

.detail h2 {
  margin: 14px 0 8px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--line);
  color: var(--ink-2);
}

.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
}

.pill.ok {
  background: color-mix(in srgb, var(--pine) 14%, transparent);
  color: var(--pine);
}

.pill.warn {
  background: rgba(214, 150, 20, 0.14);
  color: #a86b00;
}

[data-theme="dark"] .pill.warn {
  color: #f1b64a;
}

.pill .icon {
  width: 14px;
  height: 14px;
}

.desc {
  margin: 16px 0 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 8px;
  margin: 20px 0 6px;
}

.action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background 0.15s ease, transform 0.15s var(--ease), border-color 0.15s ease, color 0.15s ease;
}

.action:hover {
  background: var(--card-hover);
  border-color: var(--line-2);
  color: var(--ink);
  transform: translateY(-1px);
}

.action.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

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

.section {
  padding: 18px 24px 4px;
}

.section h3 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
}

.rows li + li {
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  text-decoration: none;
  font-size: 13.5px;
  transition: background 0.15s ease;
}

a.row:hover {
  background: var(--card-hover);
}

.row .icon {
  color: var(--ink-3);
}

.row .label {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
}

.row .value {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 520;
}

.row .go {
  width: 15px;
  height: 15px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

a.row:hover .go {
  opacity: 1;
}

.socials {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
}

.social {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  transition: transform 0.15s var(--ease), background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.social:hover {
  transform: translateY(-1px);
  background: var(--brand-bg, var(--ink));
  border-color: transparent;
  color: #fff;
}

.social .icon {
  width: 17px;
  height: 17px;
}

.neighbors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.neighbor {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-2);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.neighbor:hover {
  color: var(--ink);
  border-color: var(--ink-3);
}

.neighbor .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
  flex: none;
}

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

.more {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  padding: 6px 4px;
}

.source {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 18px 24px 24px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
  font-size: 12px;
  color: var(--ink-3);
}

.source a {
  color: var(--ink-2);
  font-weight: 600;
  text-underline-offset: 3px;
}

/* Place (building) view */

.tenant-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tenant-list .card {
  animation: none;
}

/* --------------------------------------------------------- Map controls */

.map-controls {
  position: fixed;
  z-index: 9;
  right: calc(var(--gap) + 4px);
  bottom: 36px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: right 0.45s var(--ease);
}

body.detail-open .map-controls {
  right: calc(var(--detail-w) + var(--gap) * 2);
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
}

.ctrl-group .icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 0;
  color: var(--ink-2);
}

.ctrl-group .icon-btn + .icon-btn {
  border-top: 1px solid var(--line);
}

.ctrl-group .icon-btn[aria-pressed="true"] {
  color: var(--accent);
}

.legend {
  position: fixed;
  z-index: 9;
  left: calc(var(--panel-w) + var(--gap) * 2);
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-2);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: conic-gradient(#14967f 0 25%, #4f5bd5 0 50%, #e8513f 0 75%, #d99a1e 0);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line-2);
}

.legend i.bldg {
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid var(--ink);
  box-shadow: none;
}

.legend i.area {
  border-radius: 3px;
  background: transparent;
  border: 1.5px dashed var(--pine);
  box-shadow: none;
}

/* ----------------------------------------------------------------- About */

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 21, 18, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: min(720px, 100%);
  overflow-y: auto;
  padding: 28px 30px 26px;
  border-radius: var(--radius-xl);
  background: var(--panel-solid);
  box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.3s var(--ease);
}

.modal.open .modal-card {
  transform: none;
}

.modal-card h2 {
  margin: 6px 0 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.015em;
}

.modal-card p,
.modal-card li {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.6;
}

.modal-card ul {
  padding-left: 18px;
}

.modal-card .icon-btn {
  position: absolute;
  top: 16px;
  right: 16px;
}

.modal-card .fine {
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ---------------------------------------------------------------- Toast */

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.3s var(--ease);
}

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

/* ---------------------------------------------------------------- Loader */

.boot {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: var(--paper);
  transition: opacity 0.5s ease, visibility 0.5s;
}

.boot.done {
  opacity: 0;
  visibility: hidden;
}

.boot svg {
  width: 56px;
  height: 56px;
}

.boot .edge {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw 1.2s var(--ease) infinite alternate;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ----------------------------------------------------------- Mobile view */

.sheet-handle {
  display: none;
}

@media (max-width: 860px) {
  :root {
    --gap: 10px;
  }

  #map::after {
    background: radial-gradient(120% 80% at 50% 30%, transparent 55%, rgba(16, 35, 28, 0.12) 100%);
  }

  .panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: 86dvh;
    border-radius: 26px 26px 0 0;
    border-bottom: 0;
    transform: translateY(calc(86dvh - var(--sheet-peek, 208px)));
    transition: transform 0.45s var(--ease);
  }

  .panel.sheet-half {
    transform: translateY(40dvh);
  }

  .panel.sheet-full {
    transform: none;
  }

  .panel.dragging {
    transition: none;
  }

  .sheet-handle {
    display: block;
    width: 100%;
    height: 22px;
    flex: none;
    position: relative;
    touch-action: none;
  }

  .sheet-handle::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 50%;
    width: 42px;
    height: 5px;
    margin-left: -21px;
    border-radius: 5px;
    background: var(--line-2);
  }

  .panel-head {
    padding: 0 16px;
  }

  .hero {
    margin: 4px 0 12px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .stats {
    font-size: 12px;
  }

  .chips {
    padding: 2px 16px 10px;
    margin: 0 -16px;
  }

  .toolbar {
    padding: 8px 16px;
  }

  .results {
    padding: 4px 8px calc(16px + env(safe-area-inset-bottom));
  }

  .detail {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: 72dvh;
    border-radius: 26px 26px 0 0;
    transform: translateY(100%);
    z-index: 30;
  }

  .detail.open {
    transform: none;
  }

  .legend {
    display: none;
  }

  .map-controls {
    top: calc(var(--gap) + env(safe-area-inset-top));
    bottom: auto;
    right: var(--gap);
  }

  body.detail-open .map-controls {
    right: var(--gap);
  }

  .search kbd {
    display: none;
  }
}

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