 html, body {
      margin: 0;
      padding: 0;
    }

    #map {
      width: 100vw;
      height: 100vh;
      height: 100dvh;
    }

    #filterToggleButton {
      position: absolute;
      top: 10px;
      left: 10px;
      z-index: 20;
      background: rgba(255, 255, 255, 0.95);
      border: none;
      border-radius: 6px;
      padding: 10px 14px;
      font: 14px Arial, sans-serif;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
      cursor: pointer;
    }

    #filters {
      position: absolute;
      top: 56px;
      left: 10px;
      z-index: 15;
      background: rgba(255, 255, 255, 0.95);
      padding: 10px 12px;
      border-radius: 6px;
      font: 14px Arial, sans-serif;
      line-height: 1.6;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
      min-width: 220px;
      max-width: 260px;
      display: none;
    }

    #filters.open {
      display: block;
    }

    #filters strong {
      display: block;
      margin-bottom: 4px;
    }

    #filters label {
      display: block;
      cursor: pointer;
    }

#masterToggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
}

#masterToggle input {
  display: none;
}

.toggle-slider {
  display: inline-block;
  position: relative;
  width: 44px;
  height: 24px;
  background: #888;
  border-radius: 999px;
  transition: background 0.2s ease;
  flex-shrink: 0;
  vertical-align: middle;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

#masterToggle input:checked + .toggle-slider {
  background: #4caf50;
}

#masterToggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-label {
  font: 14px Arial, sans-serif;
  line-height: 1;
}

.maplibregl-popup-content {
  background: transparent;
  box-shadow: none;
  padding: 0;
  width:auto;
}

.maplibregl-popup-tip {
  display: none;
}

.map-popup {
  display: inline-block;
  width: max-content;
  max-width: 260px;
  min-width: 0;
  word-break: normal;
  overflow-wrap: break-word;
  background: #2b2b2b;
  border: 2px solid #999;
  border-radius: 6px;
  padding: 8px 10px;
  font: 14px Arial, sans-serif;
  color: #fff;
}

.map-popup strong {
  display: block;
  margin-bottom: 4px;
}

.map-popup ul {
  margin: 6px 0 0 18px;
  padding: 0;
}

.popup-campfire,.popup-bellpost {  color: #ffd84d;  border-color: #ffd84d;}
.popup-flaskshard,.popup-flasksilverdust {  color: #5ee36b;  border-color: #5ee36b;}
.popup-charmstone,.popup-charm {  color: #cc99ff;  border-color: #cc99ff;}
.popup-emberofwont {  color: #ff9a2f;  border-color: #ff9a2f;}
.popup-mirrorshard {  color: #5de7ff;  border-color: #5de7ff;}
.popup-apobench {  color: #ff7ac8;  border-color: #ff7ac8;}
.popup-weapon,.popup-firearm, .popup-bandolierstrap{  color: #ff2063;  border-color: #ff2063 ;}
.popup-keyitem, .popup-whiskey {  color: #00ff00;  border-color: #00ff00;}
.popup-eye{  color: #93ffe9;  border-color: #93ffe9;}
.popup-boss{  color: #ff0000;  border-color: #ff0000;}
.popup-npc {  color: #bbd400;  border-color: #bbd400;}
.popup-npc li { color: white;}
.popup-tool {  color: #ff00ff;  border-color: #ff00ff;}

.popup-sub {
  margin-top: 4px;
  opacity: 0.8;
  font-size: 13px;
}

.popup-note {
  color: #eeeeee;
  opacity: 0.9;
}

.popup-note p {
  margin: 10px 0 6px 0;
  line-height: 1.5;
}

.popup-note p:last-child {
  margin-bottom: 0;
}

.note-keyitem, .note-flaskshard, .note-flasksilverdust, .note-whiskey { color: #00ff00; font-weight: bold;}
.note-charm, .note-charmstone   { color: #cc99ff; font-weight: bold;}
.note-eye     { color: #93ffe9; font-weight: bold;}
.note-npc     { color: #bbd400; font-weight: bold;}
.note-weapon  { color: #ff2063; font-weight: bold;}
.note-tool    { color: #ff00ff; font-weight: bold;}
.note-boss    { color: #ff0000; font-weight: bold;}

    @media (max-width: 700px) {
      #filters {
        max-width: calc(100vw - 40px);
      }
    }