.bhgpxrp__divider {
  background: #999;
  height: 1px;
  margin: 1.5rem 0;
}

.bhgpxrp {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #173026;
  margin: 0;
  overflow: hidden;
  padding: 1rem 0.75rem;
  position: relative;
}

.bhgpxrp__controls {
  align-items: center;
  background: #f3f4f6;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 0;
  position: sticky;
  top: 0;
  z-index: 5;
}

.bhgpxrp .btn {
  font-size: 12px;
  line-height: 1.2;
}

.bhgpxrp__toggle {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 8px;
  color: #173026;
  display: inline-flex;
  gap: 0.45rem;
  min-height: 34px;
  padding: 0.35rem 0.65rem;
}

.bhgpxrp__follow {
  accent-color: #08c;
  margin: 0;
}

.bhgpxrp__btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.bhgpxrp__exportBtn {
  margin-left: auto;
}

.bhgpxrp__status {
  color: #53645c;
  flex: 1 1 260px;
  font-size: 14px;
  margin: 0;
}

.bhgpxrp__status--error {
  color: #b91c1c;
  font-weight: 700;
}

.bhgpxrp--busy::after {
  animation: bhgpxrp-shimmer 1.4s infinite linear;
  background-image: linear-gradient(110deg, rgba(229, 231, 235, 0) 25%, rgba(255, 255, 255, 0.55) 37%, rgba(229, 231, 235, 0) 63%);
  background-size: 200% 100%;
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 20;
}

@keyframes bhgpxrp-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.bhgpxrp__stats {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 1rem 0;
}

.bhgpxrp__stat {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 0.85rem;
}

.bhgpxrp__stat span {
  color: #64748b;
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bhgpxrp__stat strong {
  color: #0f3d2e;
  display: block;
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.1;
  margin-top: 0.25rem;
}

.bhgpxrp__kmStats {
  display: flex;
  gap: 0.75rem;
  margin: -0.25rem 0 1rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.65rem;
  scroll-snap-type: x proximity;
}

.bhgpxrp__kmStats[hidden] {
  display: none;
}

.bhgpxrp__kmStat {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  flex: 0 0 178px;
  padding: 0.75rem;
  scroll-snap-align: start;
  text-align: left;
}

.bhgpxrp__kmStat span,
.bhgpxrp__kmStat small {
  color: #64748b;
  display: block;
  font-style: normal;
}

.bhgpxrp__kmStat span {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bhgpxrp__kmStat small {
  font-size: 13px;
  line-height: 1.35;
  margin-top: 0.35rem;
}

.bhgpxrp__mapContainer {
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-top: 0;
  height: 600px;
  overflow: hidden;
  position: relative;
}

.bhgpxrp__map {
  min-height: 420px;
  overflow: hidden;
  width: 100%;
}

.bhgpxrp__scrollHint {
  align-items: center;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  display: flex;
  font-size: 18px;
  font-weight: 700;
  inset: 0;
  justify-content: center;
  opacity: 0;
  padding: 2rem;
  pointer-events: none;
  position: absolute;
  text-align: center;
  transition: opacity 160ms ease-in;
  z-index: 900;
}

.bhgpxrp__scrollHint.is-visible {
  opacity: 1;
}

.bhgpxrp__map.leaflet-container,
.bhgpxrp__map .leaflet-grab,
.bhgpxrp__map .leaflet-dragging .leaflet-grab,
.bhgpxrp__map .leaflet-tile,
.bhgpxrp__map .leaflet-pane,
.bhgpxrp__map .leaflet-interactive,
.bhgpxrp__map .leaflet-marker-icon {
  cursor: crosshair !important;
}

.bhgpxrp--dragging .leaflet-grab,
.bhgpxrp--dragging .leaflet-interactive,
.bhgpxrp--dragging .leaflet-marker-icon,
.bhgpxrp__map.leaflet-dragging,
.bhgpxrp__map.leaflet-dragging .leaflet-grab,
.bhgpxrp__map.leaflet-dragging .leaflet-pane,
.bhgpxrp__map.leaflet-dragging .leaflet-marker-icon {
  cursor: grabbing !important;
}

.bhgpxrp .leaflet-control,
.bhgpxrp .leaflet-control * {
  cursor: auto !important;
}

.bhgpxrp .leaflet-control a,
.bhgpxrp .leaflet-control button,
.bhgpxrp__deleteWaypoint {
  cursor: pointer !important;
}

.bhgpxrp .leaflet-control input {
  cursor: text !important;
}

.bhgpxrp .leaflet-top.leaflet-left {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  z-index: 1001;
}

.bhgpxrp .leaflet-top.leaflet-right .leaflet-control-layers {
  display: block !important;
}

.bhgpxrp__searchControl {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(15, 48, 38, 0.16);
  margin-left: 0 !important;
  overflow: hidden;
  width: clamp(280px, 34vw, 360px);
  z-index: 1002;
}

.bhgpxrp__searchForm {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 32px auto;
  width: 100%;
}

.bhgpxrp__searchInput {
  border: 0;
  color: #173026;
  font-size: 13px;
  grid-column: 1;
  grid-row: 1;
  height: 32px;
  min-width: 0;
  padding: 0 0.65rem;
}

.bhgpxrp__searchInput:focus {
  outline: 0;
}

.bhgpxrp__searchClose {
  appearance: none;
  background: transparent;
  border: 0;
  color: #64748b;
  font-size: 18px;
  grid-column: 2;
  grid-row: 1;
  height: 32px;
  line-height: 1;
  padding: 0;
  width: 32px;
}

.bhgpxrp__searchClose:hover,
.bhgpxrp__searchClose:focus {
  color: #0077b3;
}

.bhgpxrp__searchButton {
  appearance: none;
  background: #08c;
  border: 0;
  color: #fafafa;
  font-size: 12px;
  font-weight: 700;
  grid-column: 3;
  grid-row: 1;
  padding: 0 0.65rem;
  text-transform: uppercase;
}

.bhgpxrp__searchButton:hover,
.bhgpxrp__searchButton:focus {
  background: #0077b3;
  color: #ffffff;
}

.bhgpxrp__searchStatus {
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #d1d5db;
  color: #53645c;
  display: none;
  font-size: 12px;
  grid-column: 1 / -1;
  grid-row: 2;
  line-height: 1.3;
  padding: 0.45rem 0.65rem;
}

.bhgpxrp__searchStatus:not(:empty) {
  display: block;
}

.bhgpxrp__searchResults {
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid #d1d5db;
  display: none;
  grid-column: 1 / -1;
  grid-row: 3;
  max-height: 210px;
  max-width: 100%;
  overflow-y: auto;
  width: 100%;
}

.bhgpxrp__searchResults:not(:empty) {
  display: block;
}

.bhgpxrp__searchResult {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  color: #173026;
  display: block;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  padding: 0.55rem 0.65rem;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.bhgpxrp__searchResult:hover,
.bhgpxrp__searchResult:focus {
  background: #f3f4f6;
  color: #0077b3;
  outline: 0;
}

.bhgpxrp .leaflet-control-layers,
.bhgpxrp .leaflet-popup-content-wrapper {
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(15, 48, 38, 0.18);
  color: #173026;
}

.bhgpxrp .leaflet-control-layers {
  padding: 0.3rem 0.4rem;
}

.bhgpxrp .leaflet-control-layers label {
  color: #173026;
  font-size: 13px;
}

.bhgpxrp .leaflet-popup-content {
  font-size: 14px;
  margin: 0.85rem;
}

.bhgpxrp .leaflet-popup-tip {
  box-shadow: 0 10px 25px rgba(15, 48, 38, 0.14);
}

.bhgpxrp .leaflet-container a.leaflet-popup-close-button {
  color: #173026;
}

.bhgpxrp .leaflet-container a.leaflet-popup-close-button:hover {
  color: #0077b3;
}

#TB_window {
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 48, 38, 0.3);
  overflow: hidden;
}

#TB_title {
  background: #f3f4f6;
  border-bottom: 1px solid #d1d5db;
  color: #173026;
  font-family: inherit;
}

#TB_ajaxWindowTitle {
  font-weight: 700;
}

#TB_closeWindowButton:focus .tb-close-icon,
#TB_closeWindowButton:hover .tb-close-icon {
  color: #0077b3;
}

.bhgpxrp__waypointLabel {
  background: #0f3d2e;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15, 61, 46, 0.3);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  height: 20px;
  line-height: 16px;
  margin: 0;
  padding: 0;
  text-align: center;
  width: 20px;
}

.bhgpxrp__waypointLabel::before {
  display: none;
}

.bhgpxrp__deleteWaypoint {
  appearance: none;
  background: #08c;
  border: 0;
  border-radius: 4px;
  color: #fafafa;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  padding: 0.35rem 0.55rem;
}

.bhgpxrp__deleteWaypoint:hover {
  background: #0077b3;
  color: #ffffff;
}

.bhgpxrp__chartWrap {
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 0;
  margin-top: 1rem;
  min-height: 260px;
  overflow-x: hidden;
  position: relative;
}

.bhgpxrp__empty {
  align-items: center;
  color: #64748b;
  display: flex;
  font-size: 15px;
  inset: 0;
  justify-content: center;
  min-height: 260px;
  padding: 2rem;
  text-align: center;
}

.bhgpxrp__chartWrap.has-chart .bhgpxrp__empty {
  display: none;
}

.bhgpxrp__svg {
  display: block;
  max-width: 100%;
  min-width: 100%;
}

.bhgpxrp__grid {
  stroke: #dbe7df;
  stroke-width: 1;
}

.bhgpxrp__axisLabel,
.bhgpxrp__km-label,
.bhgpxrp__elevation-label {
  fill: #64748b;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
}

.bhgpxrp__area {
  fill: url(#bhgpxrp-area-gradient);
}

.bhgpxrp__line {
  fill: none;
  filter: drop-shadow(0 8px 10px rgba(21, 128, 61, 0.2));
  stroke: url(#bhgpxrp-line-gradient);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.bhgpxrp__km-line {
  stroke: rgba(22, 101, 52, 0.16);
  stroke-dasharray: 4 7;
  stroke-width: 1;
}

.bhgpxrp__km-dot {
  fill: #ffffff;
  stroke: #16a34a;
  stroke-width: 2;
}

@media (max-width: 800px) {
  .bhgpxrp__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .bhgpxrp {
    padding: 0.5rem;
  }

  .bhgpxrp__exportBtn {
    margin-left: 0;
  }

  .bhgpxrp__map {
    min-height: 320px;
  }

  .bhgpxrp .leaflet-top.leaflet-left {
    align-items: flex-start;
    flex-direction: column;
  }

  .bhgpxrp .leaflet-top.leaflet-right .leaflet-control-layers {
    margin-top: 52px;
  }

  .bhgpxrp__searchInput {
    width: auto;
  }

  .bhgpxrp__searchForm {
    grid-template-columns: minmax(120px, 1fr) 32px auto;
  }

  .bhgpxrp__searchControl {
    width: clamp(240px, calc(100vw - 32px), 320px);
  }
}

@media (max-width: 420px) {
  .bhgpxrp__stats {
    grid-template-columns: 1fr;
  }
}
