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

body {
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  background: #F7F5F0;
  color: #1A1A1A;
  overflow: hidden;
  height: 100dvh;
  width: 100vw;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* ── Top Bar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  border-bottom: 2px solid #1A1A1A;
  flex-shrink: 0;
  background: #fff;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-icon {
  width: 22px;
  height: 22px;
  color: #D4763A;
}

.topbar-title {
  font-family: "Space Mono", monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #1A1A1A;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.btn-filter {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 7px 16px;
  border: 1.5px solid #1A1A1A;
  background: transparent;
  color: #1A1A1A;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-filter:hover {
  background: #1A1A1A;
  color: #fff;
}

.btn-spin {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 7px 20px;
  border: none;
  background: #D4763A;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-spin:hover {
  opacity: 0.85;
}

/* ── Main Layout ── */
.main {
  flex: 1;
  display: grid;
  grid-template-columns: 2fr 3fr;
  min-height: 0;
}

/* ── Spinner Panel ── */
.panel-spinner {
  display: flex;
  flex-direction: column;
  border-right: 2px solid #1A1A1A;
  background: #F7F5F0;
  position: relative;
  overflow: hidden;
}

.spinner-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#radialSvg {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  cursor: pointer;
}

.spinner-hint {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #999;
  text-align: center;
  padding: 10px;
  border-top: 1px solid #E0DDD6;
}

/* ── Right Panel ── */
.panel-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}

/* ── Section Labels ── */
.section-label {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #999;
  padding: 10px 20px;
  border-bottom: 1px solid #E8E5DE;
  background: #FAFAF7;
}

/* ── Map ── */
.map-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-bottom: 2px solid #1A1A1A;
}

#map {
  flex: 1;
  background: #EDEAE3;
  min-height: 0;
}

.leaflet-control-attribution {
  font-size: 9px !important;
  background: rgba(247, 245, 240, 0.85) !important;
  font-family: "Space Mono", monospace !important;
}

/* ── Details ── */
.details-section {
  flex-shrink: 0;
}

.details-content {
  display: flex;
  align-items: stretch;
  gap: 24px;
  padding: 16px 24px;
}

.details-image-wrap {
  flex-shrink: 0;
  width: 140px;
  overflow: hidden;
}

.details-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #EDEAE3;
}

.details-info {
  flex: 1;
  min-width: 0;
}

.trail-name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #1A1A1A;
  line-height: 1.1;
  margin-bottom: 8px;
}

.trail-divider {
  height: 2px;
  background: #D4763A;
  width: 40px;
  margin-bottom: 12px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1.5px solid #E0DDD6;
  margin-bottom: 12px;
}

.stat-cell {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-cell:nth-child(1) { border-right: 1.5px solid #E0DDD6; border-bottom: 1.5px solid #E0DDD6; }
.stat-cell:nth-child(2) { border-bottom: 1.5px solid #E0DDD6; }
.stat-cell:nth-child(3) { border-right: 1.5px solid #E0DDD6; }

.stat-label {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: #999;
}

.stat-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #1A1A1A;
}

.link-alltrails {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #999;
  text-decoration: none;
  transition: color 0.15s;
}

.link-alltrails:hover {
  color: #D4763A;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

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

.modal {
  background: #fff;
  padding: 24px 28px;
  min-width: 320px;
  max-width: 380px;
  border: 2px solid #1A1A1A;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #999;
  line-height: 1;
  padding: 0 4px;
}

.modal-close:hover {
  color: #1A1A1A;
}

.modal-section {
  margin-bottom: 16px;
}

.modal-section-label {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #999;
  display: block;
  margin-bottom: 10px;
}

.modal-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-checkboxes label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.modal-checkboxes input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #D4763A;
  cursor: pointer;
}

/* ── SEO Content (crawlable, not visible in app) ── */
.seo-content {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── Leaflet overrides ── */
.leaflet-interactive {
  transition: fill 0.2s, r 0.2s;
}

