.pbm-public {
  width: min(1200px, 100%);
  max-width: 1200px;
  margin-right: auto;
  margin-left: auto;
}

.pbm-map-frame {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  line-height: 0;
}

.pbm-map-frame img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
}

.pbm-overlay,
.pbm-marker-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pbm-overlay {
  z-index: 2;
  pointer-events: none;
}

.pbm-marker-layer {
  z-index: 3;
  pointer-events: none;
}

.pbm-route-line {
  fill: none;
  stroke-width: .55;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1.4 1.15;
  vector-effect: non-scaling-stroke;
}

.pbm-admin-path-line {
  fill: none;
  stroke: #d63638;
  stroke-width: 3px;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: none;
  vector-effect: non-scaling-stroke;
}

.pbm-zone-shape {
  fill: transparent;
  stroke: transparent;
  stroke-width: .28;
  vector-effect: non-scaling-stroke;
}

.pbm-admin .pbm-zone-shape {
  fill: rgba(34, 113, 177, .08);
  stroke: rgba(34, 113, 177, .85);
}

.pbm-map-frame.is-simulating .pbm-admin-path-line,
.pbm-map-frame.is-simulating .pbm-zone-shape,
.pbm-map-frame.is-simulating .pbm-marker-admin {
  display: none !important;
}

.pbm-zone-hotspot {
  cursor: pointer;
  pointer-events: auto;
}

.pbm-zone-hotspot:hover,
.pbm-zone-hotspot:focus {
  fill: transparent;
  outline: none;
}

.pbm-admin .pbm-zone-hotspot:hover,
.pbm-admin .pbm-zone-hotspot:focus {
  fill: rgba(34, 113, 177, .18);
}

.pbm-zone-draft {
  fill: none;
  stroke: #d63638;
  stroke-width: .35;
  stroke-dasharray: 1 1;
  vector-effect: non-scaling-stroke;
}

.pbm-zone-draft-point {
  fill: #d63638;
  stroke: #fff;
  stroke-width: .28;
  vector-effect: non-scaling-stroke;
}

.pbm-marker {
  --pbm-color: #1f7fc0;
  --pbm-size: 18px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  width: var(--pbm-size);
  height: var(--pbm-size);
  min-width: var(--pbm-size);
  padding: 0;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--pbm-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .28);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: auto;
}

.pbm-marker::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 2px solid var(--pbm-color, #1f7fc0);
  border-radius: inherit;
  animation: pbm-pulse 1.35s ease-out infinite;
}

.pbm-marker span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.pbm-marker-admin::after {
  animation: none;
}

.pbm-simulation-marker {
  position: absolute;
  z-index: 8;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #d63638;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .34);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.pbm-simulation-marker::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 2px solid #d63638;
  border-radius: inherit;
  animation: pbm-pulse 1.1s ease-out infinite;
}

.pbm-marker-moving {
  z-index: 6;
}

@keyframes pbm-pulse {
  0% {
    opacity: .75;
    transform: scale(.65);
  }
  100% {
    opacity: 0;
    transform: scale(1.55);
  }
}

.pbm-legend {
  width: min(1200px, 100%);
  max-width: 1200px;
  margin: 0 auto 12px;
  padding: 10px 12px;
  border-left: 4px solid #1f7fc0;
  background: #f6f7f7;
  color: #1d2327;
  font-size: 15px;
  line-height: 1.4;
  white-space: normal !important;
}

.pbm-legend-line {
  display: block !important;
  margin: 0;
  line-height: 1.4;
}

.pbm-popup {
  position: absolute;
  z-index: 5;
  max-width: min(280px, 72vw);
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
  color: #1d2327;
  font-size: 14px;
  line-height: 1.35;
  transform: none !important;
  pointer-events: none;
}

.pbm-popup[aria-hidden="true"] {
  display: none;
}

.pbm-popup strong {
  display: block;
  margin-bottom: 5px;
}

.pbm-popup div {
  white-space: pre-line;
}

.pbm-admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 16px 0;
}

.pbm-admin-toolbar #pbm-status {
  margin-left: 8px;
  color: #d63638;
  font-weight: 600;
}

.pbm-admin-toolbar #pbm-status.is-ok,
.pbm-save-status.is-ok {
  color: #008a20;
}

.pbm-admin-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 1200px;
  margin-bottom: 16px;
}

.pbm-admin-fields label,
.pbm-edit-card label {
  display: grid;
  gap: 5px;
  font-weight: 600;
}

.pbm-admin-fields textarea,
.pbm-edit-card input,
.pbm-edit-card textarea {
  width: 100%;
}

.pbm-route-preview {
  max-width: 1200px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid #c3c4c7;
  border-left: 5px solid #1f7fc0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
}

.pbm-route-preview[hidden] {
  display: none !important;
}

.pbm-route-preview__head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pbm-route-preview__head h2 {
  margin: 0;
}

.pbm-route-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.pbm-route-list__item {
  padding: 12px;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  background: #f6f7f7;
}

.pbm-route-list__title {
  margin-bottom: 8px;
  color: #1d2327;
  font-weight: 700;
}

.pbm-route-list dl {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 5px 12px;
  margin: 0;
}

.pbm-route-list dt {
  color: #646970;
  font-weight: 700;
}

.pbm-route-list dd {
  margin: 0;
}

.pbm-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.pbm-side-panel {
  max-height: 78vh;
  overflow: auto;
  padding-right: 8px;
}

.pbm-side-actions {
  position: sticky;
  top: 32px;
  z-index: 10;
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid #c3c4c7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}

.pbm-side-actions .button {
  justify-content: center;
  width: 100%;
  text-align: center;
}

.pbm-side-hint {
  color: #646970;
  font-size: 12px;
  line-height: 1.35;
}

.pbm-save-status {
  min-height: 17px;
  color: #d63638;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.pbm-side-panel h2 {
  margin: 0 0 10px;
}

.pbm-edit-card {
  display: grid;
  gap: 0;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #c3c4c7;
  border-radius: 8px;
  background: #fff;
}

.pbm-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.pbm-zone-card .pbm-card-head {
  grid-template-columns: minmax(0, 1fr) auto;
}

.pbm-card-body {
  display: none;
  gap: 10px;
  padding-top: 12px;
}

.pbm-edit-card.is-open .pbm-card-body {
  display: grid;
}

.pbm-card-toggle {
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1d2327;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pbm-card-toggle::before {
  content: "\25B8";
  display: inline-block;
  margin-right: 6px;
  color: #646970;
}

.pbm-edit-card.is-open .pbm-card-toggle::before {
  transform: rotate(90deg);
}

.pbm-drag-handle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  background: #f6f7f7;
  color: #1d2327;
  font-weight: 700;
  cursor: grab;
}

.pbm-drag-handle::before {
  content: "\2630";
  font-size: 14px;
  line-height: 1;
}

.pbm-point-card.ui-sortable-helper {
  cursor: grabbing;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
}

.pbm-sort-placeholder {
  min-height: 86px;
  margin-bottom: 12px;
  border: 2px dashed #2271b1;
  border-radius: 8px;
  background: rgba(34, 113, 177, .08);
}

.pbm-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pbm-path-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.pbm-path-actions small {
  grid-column: 1 / -1;
}

.pbm-edit-card small {
  color: #646970;
}

@media (max-width: 980px) {
  .pbm-admin-layout,
  .pbm-admin-fields {
    grid-template-columns: 1fr;
  }

  .pbm-side-panel {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .pbm-popup {
    max-width: 84vw;
    font-size: 13px;
  }

  .pbm-legend {
    font-size: 14px;
  }
}
