html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
}

.map-wrap {
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.map-header {
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid #d9d9d9;
  z-index: 1;
}

.map-header h1 {
  margin: 0 0 4px 0;
  font-size: 20px;
}

.map-header p {
  margin: 0;
  font-size: 14px;
  color: #555;
}

#map {
  flex: 1;
  min-height: 500px;
}

.mapboxgl-popup-content {
  max-width: 280px;
}

.popup-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  line-height: 1.3;
}

.popup-meta {
  margin: 0 0 8px 0;
  font-size: 12px;
  color: #666;
}

.popup-summary {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.popup-image {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 0 10px 0;
  border-radius: 6px;
}

.popup-links {
  margin: 10px 0 0 0;
  font-size: 13px;
}

.popup-links a {
  color: #D52B1E;
  text-decoration: none;
  font-weight: 600;
}

.popup-links a:hover {
  text-decoration: underline;
}

.map-legend {
  position: absolute;
  bottom: 30px;
  left: 30px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.96);
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
  font-size: 13px;
  color: #2B2B2B;
  min-width: 165px;
}

.legend-title {
  font-weight: 600;
  margin-bottom: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.legend-item:last-child {
  margin-bottom: 0;
}

.legend-line {
  display: inline-block;
  width: 28px;
  height: 0;
  margin-right: 10px;
  flex: 0 0 auto;
}

.legend-line-completed {
  border-top: 2px solid #D52B1E;
}

.legend-line-planned {
  border-top: 2px dashed #2B2B2B;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 10px;
  border: 1.5px solid #ffffff;
  flex: 0 0 auto;
}

.legend-dot-visited {
  background: #D52B1E;
}

.legend-dot-planned {
  background: #8C8C8C;
}
