html, body {
  height: 100%;
  margin: 0;
  background: #202020;
  color: #eee;
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  height: 100vh;
}

.map-wrap {
  min-width: 0;
  position: relative;
}

.topbar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  background: #171717;
  border-bottom: 1px solid #333;
  box-sizing: border-box;
}

#status {
  margin-left: 10px;
  color: #aaa;
  font-size: 13px;
}

#map {
  height: calc(100vh - 44px);
  background: #2f2f2f;
}

.sidebar {
  overflow: auto;
  background: #1b1b1b;
  border-left: 1px solid #333;
  padding: 12px 12px 24px;
  box-sizing: border-box;
}

.sidebar h1 {
  margin: 0 0 12px;
  font-size: 20px;
}

.group {
  margin-bottom: 18px;
}

.group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
}

.group-title.containers { color: #ffc05d; }
.group-title.loot { color: #ffc05d; }
.group-title.enemy { color: #ff7070; }
.group-title.extract { color: #00c99a; }
.group-title.quest { color: #ddd2a1; }
.group-title.locked { color: #9cc9ff; }
.group-title.notes { color: #bbb; }

.group-actions {
  white-space: nowrap;
  font-size: 11px;
}

.group-actions button,
.actions button {
  border: 0;
  border-radius: 4px;
  padding: 5px 8px;
  background: #00b889;
  color: #071512;
  font-weight: 700;
  cursor: pointer;
}

.group-actions button.secondary,
.actions button.secondary {
  background: #343434;
  color: #ddd;
}

.items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.filter {
  display: flex;
  align-items: center;
  min-height: 30px;
  gap: 6px;
  padding: 6px 7px;
  border-radius: 3px;
  background: #ffc05d;
  color: #2b261f;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.filter.off {
  opacity: .35;
  filter: grayscale(.7);
}

.filter img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 16px;
}

.filter input {
  display: none;
}

.marker-icon {
  filter: drop-shadow(0 1px 1px #000) drop-shadow(0 0 2px #000);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #202020;
  color: #eee;
}

/* Critical Leaflet layout rules. Keep local because CDN CSS may fail under file://. */
.leaflet-container {
  overflow: hidden;
  position: relative;
  outline-style: none;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-control { position: relative; z-index: 800; pointer-events: auto; }
.leaflet-top, .leaflet-bottom { position: absolute; z-index: 1000; pointer-events: none; }
.leaflet-top { top: 0; }
.leaflet-bottom { bottom: 0; }
.leaflet-left { left: 0; }
.leaflet-right { right: 0; }
.leaflet-control-container .leaflet-top.leaflet-left { position: absolute; }
.leaflet-control-zoom a {
  display: block;
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  text-decoration: none;
  background: #111;
  color: #00c99a;
  border-bottom: 1px solid #333;
}
.leaflet-control-attribution { display: none; }

.shape-label {
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
}

.map-text-marker {
  background: transparent;
  border: 0;
  pointer-events: auto;
}

.map-text-marker span {
  display: inline-block;
  min-width: 26px;
  padding: 1px 4px;
  color: #f4f4f4;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
  text-align: center;
  text-shadow: 0 1px 2px #000, 0 0 3px #000, 0 0 5px #000;
  transform-origin: left center;
}

.map-popup {
  max-width: 320px;
  font-size: 13px;
  color: #eee;
}

.popup-title {
  margin-bottom: 8px;
  color: #ffc05d;
  font-size: 15px;
  font-weight: 900;
}

.popup-trader {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.popup-trader img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.popup-link {
  display: inline-block;
  margin-bottom: 8px;
  color: #00c99a;
  font-weight: 800;
}

.popup-description {
  margin: 8px 0;
  line-height: 1.35;
}

.popup-description.error {
  color: #ff7474;
}

.popup-shot-title {
  margin: 8px 0 4px;
  color: #bbb;
  font-size: 12px;
}

.popup-shot {
  display: block;
  max-width: 300px;
  max-height: 220px;
  border-radius: 4px;
  object-fit: contain;
}

.popup-id,
.popup-hint {
  color: #999;
  font-size: 11px;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: 65vh 35vh; }
  .sidebar { border-left: 0; border-top: 1px solid #333; }
  #map { height: calc(65vh - 44px); }
}
