html, body {
  margin: 0;
  height: 100%;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

#map {
  height: 100%;
  width: 100%;
  background: #e8e5df;
}

/* --- markers --- */

.sg-marker {
  background: none;
  border: none;
}

.sg-marker-inner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid var(--sg-color, #666);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  background: #fff;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s ease-out;
}

/* the icon is a mask, so one monochrome SVG works in every category colour */
.sg-marker-icon {
  width: 22px;
  height: 22px;
  background: var(--sg-color, #666);
  -webkit-mask: var(--sg-icon) center/contain no-repeat;
  mask: var(--sg-icon) center/contain no-repeat;
}

.sg-marker:hover .sg-marker-inner,
.sg-marker-active .sg-marker-inner {
  transform: scale(1.15);
}

/* fallback when the icon file is missing: the category's initial */
.sg-marker-icon.sg-noicon {
  background: none;
  mask: none;
  -webkit-mask: none;
  color: var(--sg-color, #666);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
}

/* --- popup --- */

.leaflet-popup-content {
  margin: 12px 14px;
  width: 260px !important;
}

.sg-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.sg-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.sg-kind {
  color: var(--sg-color, #666);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.sg-date {
  color: #777;
  font-size: 12px;
}

.sg-desc {
  margin: 8px 0 0;
}

.sg-desc p {
  margin: 0 0 6px;
}

.sg-desc p:last-child,
.sg-desc ul:last-child {
  margin-bottom: 0;
}

.sg-desc ul {
  margin: 0 0 6px;
  padding-left: 20px;
}

.sg-desc a {
  color: #1a6fc4;
  overflow-wrap: anywhere;
}

.sg-desc code {
  background: #f0f0f0;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 13px;
}

.sg-photo {
  display: block;
  width: 100%;
  border-radius: 6px;
  margin-top: 10px;
}

.sg-tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.sg-tag {
  background: #eee;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 12px;
  color: #555;
}

.sg-author {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.sg-author img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--sg-color, #666);
  box-sizing: border-box;
}

.sg-author span {
  font-size: 13px;
  color: #333;
  font-weight: 500;
}

/* --- mapy.com attribution (required by their API terms) --- */

.sg-logo img {
  display: block;
  width: 62px;
}

.leaflet-control-attribution {
  font-size: 11px;
}

/* --- error banner --- */

#error {
  position: fixed;
  inset: 12px 12px auto 12px;
  z-index: 1000;
  background: #b3261e;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
}
