﻿:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe2ea;
  --brand: #0f172a;
  --brand-2: #2563eb;
  --accent: #f97316;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 9px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(1200px 500px at 100% -10%, rgba(37, 99, 235, 0.12), transparent 60%), var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 66px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.topbar-brand h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  font-family: Manrope, sans-serif;
}

.topbar-brand h1 span {
  color: var(--accent);
}

.topbar-brand p {
  margin: 0.1rem 0 0;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.mode-tags {
  display: none;
  gap: 0.35rem;
}

.mode-tag {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: #475569;
  border-radius: 999px;
  padding: 0.26rem 0.58rem;
  font-size: 0.68rem;
  font-weight: 700;
}

.mode-tag.active {
  background: #ffedd5;
  border-color: #fdba74;
  color: #9a3412;
}

.topbar-cta {
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand), #334155);
  color: #fff;
  padding: 0.52rem 0.78rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.app-shell {
  height: calc(100vh - 66px);
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  overflow: hidden;
}

.filters-panel {
  border-right: 1px solid var(--line);
  background: #f8fafc;
  padding: 0.9rem;
  overflow: auto;
}

.filter-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 0.8rem;
  margin-bottom: 0.65rem;
}

.filter-card h2 {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: #64748b;
}

.filter-card.compact {
  margin-bottom: 0;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hero-stats .pill {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 999px;
  padding: 0.28rem 0.56rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
}

.search-wrap {
  margin-bottom: 0.55rem;
}

input[type='search'] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.62rem 0.72rem;
  font-size: 0.86rem;
  outline: none;
  background: #fff;
}

input[type='search']:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

input[type='number'],
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.58rem;
  font-size: 0.8rem;
  outline: none;
  background: #fff;
  color: #1e293b;
}

input[type='number']:focus,
select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.filter-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0.45rem 0 0.3rem;
}

.chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: #1e293b;
  border-radius: 999px;
  padding: 0.34rem 0.62rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: #fdba74;
  color: #9a3412;
}

.chip.active {
  background: #ffedd5;
  border-color: #fb923c;
  color: #9a3412;
  font-weight: 700;
}

.chips-secondary .chip {
  font-size: 0.72rem;
}

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

.btn-mini {
  padding: 0.28rem 0.5rem;
  font-size: 0.72rem;
}

.adv-filters.collapsed {
  display: none;
}

.adv-grid {
  margin-top: 0.48rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.42rem;
}

.field {
  display: block;
}

.field span {
  display: block;
  font-size: 0.68rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.2rem;
}

.btn-text,
.btn-primary {
  border: 1px solid var(--line);
  background: #fff;
  color: #1e293b;
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  border-color: #0f172a;
  background: #0f172a;
  color: #fff;
}

.ux-hint {
  margin: 0.62rem 0 0;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.45;
}

.workspace-host {
  padding: 0.85rem;
  overflow: hidden;
}

.workspace {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 0.7rem;
}

.workspace.map-only {
  grid-template-columns: 1fr;
}

.workspace.map-only .workspace-list {
  display: none;
}

.workspace.list-only {
  grid-template-columns: 1fr;
}

.workspace.list-only .workspace-map {
  display: none;
}

.workspace-map,
.workspace-list {
  min-width: 0;
}

.workspace-map {
  height: 100%;
}

.map-section {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 0.7rem;
}

.map-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.7rem;
  margin-bottom: 0.58rem;
}

.view-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.view-btn {
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.38rem 0.62rem;
  cursor: pointer;
}

.view-btn.active {
  background: #0f172a;
  color: #fff;
}

.map-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  color: #334155;
  font-size: 0.8rem;
}

#map-summary {
  margin-left: auto;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 600;
}

.map-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 420px;
  border-radius: 14px;
  border: 1px solid #dbe2ea;
  overflow: hidden;
}

.map-detail-panel {
  position: absolute;
  right: 12px;
  top: 12px;
  width: min(340px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  z-index: 650;
  padding: 0.72rem;
}

.map-detail-panel.hidden {
  display: none;
}

.map-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.map-detail-title {
  margin: 0;
  font-family: Manrope, sans-serif;
  font-size: 0.96rem;
}

.map-detail-close {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 7px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  line-height: 1;
}

.map-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.42rem;
  margin-bottom: 0.48rem;
}

.map-detail-k {
  color: #64748b;
  font-size: 0.72rem;
}

.map-detail-v {
  font-weight: 700;
  font-size: 0.85rem;
}

.map-detail-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.map-detail-btn {
  border: 1px solid #0f172a;
  color: #0f172a;
  background: #fff;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.34rem 0.56rem;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.map-detail-btn.primary {
  background: #0f172a;
  color: #fff;
}

.region-map-label-wrap {
  background: transparent;
  border: 0;
}

.region-map-label {
  transform: translate(-50%, -50%);
  background: color-mix(in oklab, var(--region-color) 20%, #fff 80%);
  border: 1px solid color-mix(in oklab, var(--region-color) 68%, #1f2937 32%);
  border-radius: 999px;
  padding: 0.2rem 0.52rem;
  font-size: 0.72rem;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
}

.region-map-label.active {
  background: color-mix(in oklab, var(--region-color) 36%, #fff 64%);
}

.leaflet-tooltip.map-park-tooltip {
  background: rgba(15, 23, 42, 0.95);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
}

.workspace-list {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: auto;
}

.results-head {
  padding: 0.72rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

#results-summary {
  font-size: 0.85rem;
  font-weight: 700;
}

.results-note {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 700;
}

.inline-detail-panel {
  margin: 0.7rem;
  margin-bottom: 0;
  padding: 0.74rem;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.inline-detail-panel.hidden {
  display: none;
}

.inline-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.inline-detail-head-main {
  min-width: 0;
}

.inline-detail-title {
  margin: 0;
  font-family: Manrope, sans-serif;
  font-size: 1rem;
}

.inline-detail-sub {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: #64748b;
}

.inline-detail-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
}

.inline-detail-toggle {
  border: 1px solid #fdba74;
  background: #fff7ed;
  color: #9a3412;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.26rem 0.56rem;
  cursor: pointer;
}

.inline-detail-close {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  line-height: 1;
  cursor: pointer;
}

.inline-detail-quick {
  margin-top: 0.48rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.inline-detail-quick span {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 0.2rem 0.54rem;
  font-size: 0.74rem;
  font-family: 'JetBrains Mono', monospace;
}

.inline-detail-teaser {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: #475569;
}

.inline-detail-body {
  margin-top: 0.56rem;
}

.inline-detail-body.collapsed {
  display: none;
}

.inline-detail-grid {
  margin-top: 0.4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.42rem;
}

.inline-detail-grid .k,
.inline-detail-address .k {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 0.1rem;
}

.inline-detail-grid strong {
  font-size: 0.84rem;
}

.inline-detail-address {
  margin-top: 0.48rem;
  font-size: 0.84rem;
}

.inline-detail-summary {
  margin: 0.5rem 0 0;
  font-size: 0.84rem;
  color: #334155;
}

.inline-detail-gallery {
  margin-top: 0.58rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 0.44rem;
}

.inline-detail-gallery img {
  width: 100%;
  height: 86px;
  object-fit: cover;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #edf2f7;
}

.inline-detail-content {
  margin-top: 0.62rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 0.62rem;
  max-height: 320px;
  overflow: auto;
  font-size: 0.84rem;
  color: #1f2937;
}

.inline-detail-content img,
.inline-detail-content video,
.inline-detail-content iframe {
  max-width: 100%;
  height: auto;
}

.inline-detail-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.inline-detail-content td,
.inline-detail-content th {
  border: 1px solid #e5e7eb;
  padding: 0.34rem;
}

.inline-detail-loading {
  color: #64748b;
  font-size: 0.86rem;
}

.cards {
  flex: 0 0 auto;
  overflow: visible;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 0;
}

.card {
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.16s ease;
  min-height: 104px;
}

.card:hover {
  border-left: 4px solid var(--accent);
  transform: translateX(4px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.card-active {
  border-color: #fb923c;
  box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.2);
}

.card-hover {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.22);
}

.card-link {
  display: flex;
  gap: 0.62rem;
  color: inherit;
  text-decoration: none;
  align-items: flex-start;
  padding: 0.56rem;
}

.card-media-wrap {
  background: #e2e8f0;
  width: 110px;
  min-width: 110px;
  height: 84px;
  border-radius: 8px;
  overflow: hidden;
}

.card-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 0.02rem 0 0;
  min-width: 0;
}

.card-title {
  margin: 0;
  font-family: Manrope, sans-serif;
  font-size: 0.92rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  margin: 0.24rem 0 0;
  color: #64748b;
  font-size: 0.78rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-summary {
  margin: 0.32rem 0 0;
  color: #334155;
  font-size: 0.78rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.load-wrap {
  padding: 0.68rem;
  border-top: 1px solid var(--line);
  background: #fff;
  text-align: center;
  position: sticky;
  bottom: 0;
  z-index: 12;
}

.map-region-tooltip {
  min-width: 260px;
  padding: 0.14rem 0.06rem;
}

.map-region-tooltip h4 {
  margin: 0 0 0.35rem;
  font-family: Manrope, sans-serif;
  font-size: 0.94rem;
}

.map-region-tooltip .row {
  display: flex;
  justify-content: space-between;
  gap: 0.82rem;
  font-size: 0.84rem;
  margin: 0.08rem 0;
}

.map-region-tooltip .key {
  color: #475569;
}

.map-region-tooltip .value {
  font-weight: 700;
}

.detail-topbar {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem;
}

.back-link {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 700;
}

.detail-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.detail-head {
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 0.82rem;
  box-shadow: var(--shadow-sm);
}

.detail-head h1 {
  margin: 0;
  font-family: Manrope, sans-serif;
  font-size: clamp(1.35rem, 2.8vw, 2.1rem);
}

.detail-sub {
  margin-top: 0.3rem;
  color: #64748b;
}

.gallery {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-bottom: 0.82rem;
}

.gallery img {
  width: 100%;
  height: 168px;
  object-fit: cover;
  border-radius: 11px;
  border: 1px solid #dbe2ea;
  background: #eef2f7;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.56rem;
  margin-bottom: 0.82rem;
}

.detail-cell {
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 11px;
  padding: 0.68rem;
}

.detail-k {
  font-size: 0.74rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-v {
  margin-top: 0.26rem;
  font-weight: 700;
}

.detail-content {
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.detail-content h2 {
  margin: 0 0 0.75rem;
  font-family: Manrope, sans-serif;
}

.detail-content table {
  width: 100%;
  border-collapse: collapse;
}

.detail-content td,
.detail-content th {
  border: 1px solid #e5e7eb;
  padding: 0.42rem;
}

@media (min-width: 1220px) {
  .mode-tags {
    display: inline-flex;
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .filters-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: none;
  }

  .workspace-host {
    padding-top: 0.7rem;
    min-height: 78vh;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
  }

  .workspace-list {
    min-height: 540px;
  }

  #map {
    min-height: 460px;
  }

  .cards {
    max-height: none;
  }

  .card-link {
    display: flex;
  }

  .card-body {
    padding: 0.02rem 0 0;
  }
}

@media (min-width: 1081px) {
  .adv-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 0.72rem;
    height: 62px;
  }

  .topbar-brand p {
    display: none;
  }

  .topbar-cta {
    padding: 0.42rem 0.62rem;
    font-size: 0.68rem;
  }

  .workspace-host {
    padding: 0.62rem;
  }

  .map-section {
    padding: 0.56rem;
  }

  #map {
    min-height: 380px;
  }

  .map-detail-panel {
    left: 10px;
    right: 10px;
    width: auto;
    top: auto;
    bottom: 10px;
    max-height: 45%;
  }

  .results-head {
    padding: 0.62rem;
  }

  .cards {
    padding: 0.62rem;
    display: flex;
    flex-direction: column;
  }

  .card-link {
    display: flex;
    gap: 0.52rem;
    padding: 0.5rem;
  }

  .card-media-wrap {
    width: 92px;
    min-width: 92px;
    height: 76px;
  }

  .inline-detail-panel {
    margin: 0.62rem;
    margin-bottom: 0;
  }

  .inline-detail-grid {
    grid-template-columns: 1fr;
  }

  .inline-detail-content {
    max-height: none;
  }

  .inline-detail-head {
    align-items: flex-start;
  }

  .inline-detail-head-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .load-wrap {
    position: sticky;
    bottom: 0;
    z-index: 12;
  }
}

@media (hover: none) and (pointer: coarse) {
  .card:hover,
  .chip:hover {
    transform: none;
  }
}
/* Detail page theme parity with homepage */
.detail-page {
  min-height: 100vh;
}

.detail-shell {
  padding: 0.9rem;
}

.detail-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
}

.detail-nav-link {
  border: 1px solid var(--line);
  background: #fff;
  color: #1e293b;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.44rem 0.66rem;
  border-radius: 10px;
}

.detail-head {
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-md);
}

.detail-sub {
  font-size: 0.9rem;
}

.gallery {
  gap: 0.62rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 0.75rem;
}

.gallery img {
  height: 176px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.detail-cell {
  border-radius: 12px;
  padding: 0.72rem;
  box-shadow: var(--shadow-sm);
}

.detail-content {
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-md);
}

.detail-content h2 {
  font-size: 1.15rem;
}

.detail-content img,
.detail-content video,
.detail-content iframe {
  max-width: 100%;
  height: auto;
}

@media (max-width: 760px) {
  .detail-shell {
    padding: 0.62rem;
  }

  .detail-head,
  .detail-content {
    padding: 0.84rem;
  }

  .gallery {
    grid-template-columns: 1fr;
  }
}
