html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

#map {
  width: 100%;
  height: 100vh;
  background: #e8e6e1;
}

.leaflet-popup-content-wrapper {
  border-radius: 8px;
}

.leaflet-popup-content {
  margin: 12px 14px;
  width: 220px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  color: #2b2b2b;
}

.popup-date {
  display: block;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #d9743a;
  margin-bottom: 4px;
}

.popup-note {
  white-space: pre-line;
}

.popup-note a {
  color: #3a6ea5;
  font-weight: 600;
}

.popup-current {
  display: inline-block;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #2f9e6e;
  margin-top: 6px;
}

/* Stopover icon marker */
.stopover-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.stopover-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: transparent;
}

/* Current location marker */
.current-location-marker {
  width: 34px;
  height: 34px;
  position: relative;
}

.current-location-marker .pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  background: rgba(47, 158, 110, 0.45);
  animation: pulse 1.8s ease-out infinite;
}

.current-location-marker .pulse-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.current-location-marker .pulse-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: transparent;
}

@keyframes pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* Side panel */
#panel-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1100;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: none;
  background: #2b2b2b;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

#panel {
  position: fixed;
  top: 0;
  right: 0;
  width: max-content;
  min-width: 180px;
  max-width: 85vw;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease-out;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #2b2b2b;
}

#panel.open {
  transform: translateX(0);
}

@media (min-width: 768px) {
  #panel {
    max-width: 320px;
  }
}

#panel section {
  flex: 1 1 50%;
  overflow-y: auto;
  padding: 12px 14px;
  min-height: 0;
}

#panel h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #d9743a;
  margin: 0 0 8px;
  position: sticky;
  top: 0;
  background: #fff;
}

#panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#panel li {
  padding: 6px 4px;
  font-size: 13px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

#panel li:hover {
  background: #f5f3ef;
}

#panel li.active {
  background: #fdeee5;
  font-weight: 600;
}

.panel-current-entry::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f9e6e;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.panel-selected .stopover-icon::before {
  background: rgba(217, 116, 58, 0.35);
  box-shadow: 0 0 0 2px rgba(217, 116, 58, 0.55);
}

.panel-selected .current-location-marker .pulse-icon::before {
  background: rgba(217, 116, 58, 0.35);
  box-shadow: 0 0 0 2px rgba(217, 116, 58, 0.55);
}
