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

html, body {
  height: 100%;
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ── App layout ─────────────────────────────────────────── */

#cm-app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
}

/* ── Panel ──────────────────────────────────────────────── */

.cm-panel {
  width: 290px;
  flex-shrink: 0;
  background: #125564;
  color: #fff;
  overflow-y: auto;
  position: relative;
  z-index: 10;
}

.cm-panel-section {
  padding: 28px 22px;
}

.cm-panel-section h1 {
  font-size: 1.5rem;
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.25;
  margin-bottom: 14px;
  letter-spacing: 0.03em;
}

.cm-panel-section p {
  font-size: 0.9rem;
  line-height: 1.65;
  opacity: 0.9;
}

.cm-panel-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.cm-panel-detail-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
}

.cm-panel-close {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  margin-top: 2px;
}

.cm-panel-close:hover {
  background: rgba(255, 255, 255, 0.38);
}

.cm-detail-image-wrap {
  margin-bottom: 14px;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}

.cm-detail-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 200px;
  cursor: zoom-in;
}

/* ── Lightbox ───────────────────────────────────────────── */

.cm-lightbox {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.82);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.cm-lightbox.is-open {
  display: flex;
}

.cm-lightbox img {
  max-width: 90%;
  max-height: 85%;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  object-fit: contain;
  cursor: default;
}

.cm-lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 1;
}

.cm-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

@media (max-width: 640px) {
  .cm-lightbox {
    position: fixed;
    z-index: 1010;
  }
}

/* ── Map area ───────────────────────────────────────────── */

#cm-map-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

#cm-map {
  width: 100%;
  height: 100%;
}

/* ── Markers ────────────────────────────────────────────── */

.cm-map-marker {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.cm-bee-marker {
  background: radial-gradient(circle at 38% 35%, #ffffff, #fafafa);
  border: 3px solid #ffb031;
  box-shadow: 0 2px 8px rgba(150, 100, 0, 0.35);
}

.cm-map-marker--active {
  border-color: #e02020 !important;
  box-shadow: 0 0 0 2px rgba(224, 32, 32, 0.3), 0 2px 8px rgba(150, 100, 0, 0.35) !important;
}

/* ── Tooltip ────────────────────────────────────────────── */

.cm-map-tooltip {
  background: rgba(90, 125, 44, 0.92) !important;
  border: 1px solid rgba(90, 125, 44, 0.4) !important;
  color: #fff !important;
  border-radius: 7px !important;
  padding: 5px 12px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22) !important;
}

.leaflet-tooltip-top.cm-map-tooltip::before {
  border-top-color: rgba(60, 85, 10, 0.92) !important;
}

/* ── Mobile panel backdrop ──────────────────────────────── */

.cm-panel-backdrop {
  display: none;
}

/* ── Utilities ──────────────────────────────────────────── */

.hidden {
  display: none !important;
}

/* ── Responsive / Mobile ────────────────────────────────── */

@media (max-width: 640px) {
  #cm-app {
    max-height: none;
  }

  .cm-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(85vw, 340px);
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  }

  .cm-panel.is-open {
    transform: translateX(0);
  }

  .cm-panel-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s;
  }

  .cm-panel-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  #cm-map-wrapper {
    width: 100vw;
    height: 100dvh;
  }
}
