.p4g-pmap {
  margin-top: 0.85rem;
  border: 1px solid var(--p4g-gs-line, rgba(20, 89, 130, 0.14));
  border-radius: 12px;
  overflow: hidden;
  background: #0b1c2c;
}

.p4g-pmap[hidden] {
  display: none;
}

.p4g-pmap__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--p4g-gs-line, rgba(20, 89, 130, 0.14));
}

.p4g-pmap__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.p4g-pmap__expand {
  flex: 0 0 auto;
  margin-left: auto;
  appearance: none;
  border: 1px solid var(--p4g-gs-line, rgba(20, 89, 130, 0.22));
  background: #fff;
  color: var(--p4g-gs-ink, #0e2038);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
}

.p4g-pmap__expand:hover,
.p4g-pmap__expand:focus-visible {
  border-color: rgba(20, 89, 130, 0.45);
  outline: none;
}

body.theme-dark .p4g-pmap__toolbar {
  background: rgba(16, 35, 63, 0.96);
}

body.theme-dark .p4g-pmap__expand {
  background: rgba(8, 20, 38, 0.9);
  color: #e8eef5;
  border-color: rgba(232, 238, 245, 0.18);
}

.p4g-pmap-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--p4g-gs-ink, #0e2038);
  cursor: pointer;
  user-select: none;
}

body.theme-dark .p4g-pmap-filter {
  color: #e8eef5;
}

.p4g-pmap-filter input {
  margin: 0;
}

.p4g-pmap-filter__swatch {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  display: inline-block;
}

.p4g-pmap__canvas {
  width: 100%;
  height: min(68vh, 560px);
  min-height: 340px;
  background: #071521;
}

.p4g-pmap--expanded {
  position: fixed;
  inset: 0;
  z-index: 100050;
  margin: 0;
  border-radius: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  background: #071521;
}

.p4g-pmap--expanded .p4g-pmap__toolbar {
  flex: 0 0 auto;
}

.p4g-pmap--expanded .p4g-pmap__canvas {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

body.p4g-pmap-lock {
  overflow: hidden;
}

.p4g-pmap__error {
  margin: 0;
  padding: 0.75rem 0.9rem;
  color: #d64545;
  background: #fff;
  font-size: 0.9rem;
}

.p4g-pmap-divicon {
  background: transparent !important;
  border: 0 !important;
}

.p4g-pmap-pin {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--p4g-pmap-pin, #2bb0a6);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.p4g-pmap-pal {
  display: block;
  border-radius: 50%;
  border: 2px solid var(--p4g-ring, #ec6a6a);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
  background-color: #101820;
  background-repeat: no-repeat;
  image-rendering: auto;
}

.p4g-pmap-caticon {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(8, 18, 28, 0.75);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.p4g-pmap-popup {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  min-width: 140px;
}

.p4g-pmap-popup__art {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background-color: #101820;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.p4g-pmap-popup__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.p4g-pmap-popup__name {
  font-size: 0.98rem;
  line-height: 1.2;
}

.p4g-pmap-popup-cat {
  color: #5b6b7c;
  font-size: 0.82em;
}

.p4g-pmap-popup__level {
  font-size: 0.86rem;
  font-weight: 700;
  color: #0e2038;
}

.p4g-pmap-popup__elements {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.2rem;
}

.p4g-pmap-el {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: #e8eef5;
  color: #0e2038;
}

.p4g-pmap-el--fire { background: #ffe0d4; color: #a33a12; }
.p4g-pmap-el--water { background: #d6ecff; color: #165a9c; }
.p4g-pmap-el--grass { background: #ddf5d8; color: #2a6b22; }
.p4g-pmap-el--electric,
.p4g-pmap-el--electricity { background: #fff3c4; color: #8a6a00; }
.p4g-pmap-el--ice { background: #e4f6ff; color: #2a6f8f; }
.p4g-pmap-el--ground,
.p4g-pmap-el--earth { background: #f0e2c8; color: #7a5520; }
.p4g-pmap-el--dark { background: #e8e0f4; color: #5a3a8a; }
.p4g-pmap-el--dragon { background: #e0e8ff; color: #3a4a9a; }

.p4g-pmap-popup-wrap .leaflet-popup-content {
  margin: 0.55rem 0.7rem;
}

.p4g-pmap .leaflet-container {
  font: inherit;
  background: #071521;
}

.p4g-pmap .leaflet-control-attribution {
  font-size: 10px;
  max-width: 70%;
  background: rgba(255, 255, 255, 0.82);
}
