.mp-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.mp-overlay.is-open { display: flex; }

/* Defeat host-page global `button { width:100%; background:#4285f4; color:white }` (index.html). */
.mp-overlay button {
  width: auto !important;
  max-width: none !important;
  padding: 0;
  background: transparent;
  color: inherit;
  border: none;
  border-radius: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  box-shadow: none;
  transition: border-color 0.15s, transform 0.12s, background 0.12s;
}

.mp-panel {
  width: min(560px, 100%);
  max-height: min(92vh, 820px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mp-head {
  padding: 18px 18px 12px;
  border-bottom: 1px solid #eef0f6;
}
.mp-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #111;
}
.mp-head p {
  margin: 6px 0 0;
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
  line-height: 1.4;
}

.mp-body {
  flex: 1;
  overflow: auto;
  padding: 16px 18px 18px;
}

.mp-step { display: none; }
.mp-step.is-active { display: block; }

.mp-region-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.mp-region-btn {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100% !important;
  padding: 18px 16px !important;
  border: 2px solid #e5e7eb !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #fafafa 0%, #fff 100%) !important;
  color: #111 !important;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.15s, transform 0.12s;
}
.mp-region-btn:hover {
  border-color: #93c5fd;
  transform: translateY(-1px);
}
.mp-region-btn strong {
  display: block;
  font-size: 17px;
  color: #111;
}
.mp-region-btn span {
  font-size: 12px;
  color: #6b7280;
  font-weight: 700;
}
.mp-region-arrow {
  font-size: 20px;
  color: #2563eb;
  font-weight: 900;
}

.mp-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.mp-back-btn,
.mp-map-btn {
  padding: 8px 12px !important;
  border-radius: 10px !important;
  border: 1px solid #d8dbe7 !important;
  background: #fff !important;
  color: #111 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  cursor: pointer;
}
.mp-back-btn:hover,
.mp-map-btn:hover { background: #f3f6ff !important; }
.mp-map-btn {
  margin-left: auto;
  background: #2563eb !important;
  color: #fff !important;
  border-color: #2563eb !important;
}
.mp-map-btn:hover { background: #1d4ed8 !important; }

.mp-search {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #d8dbe7;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}
.mp-search:focus {
  outline: 2px solid #93c5fd;
  border-color: #93c5fd;
}

.mp-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow: auto;
}
.mp-list-item {
  width: 100% !important;
  text-align: left;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  border: 1px solid #eef0f6 !important;
  background: #fff !important;
  color: #111 !important;
  cursor: pointer;
  font: inherit;
  transition: background 0.12s, border-color 0.12s;
}
.mp-list-item:hover {
  background: #f3f6ff !important;
  border-color: #dbeafe !important;
}
.mp-list-item strong {
  display: block;
  font-size: 14px;
  color: #111 !important;
}
.mp-list-item span {
  font-size: 11px;
  color: #6b7280 !important;
  font-weight: 700;
}
.mp-empty {
  padding: 20px;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
}

.mp-map {
  width: 100%;
  height: 360px;
  border-radius: 14px;
  border: 1px solid #eef0f6;
  overflow: hidden;
}

.mp-confirm-card {
  text-align: center;
  padding: 24px 12px;
}
.mp-confirm-card .mp-confirm-name {
  font-size: 22px;
  font-weight: 950;
  color: #111;
  margin: 0 0 6px;
}
.mp-confirm-card .mp-confirm-district {
  font-size: 13px;
  color: #6b7280;
  font-weight: 700;
  margin: 0 0 16px;
}
.mp-confirm-warn {
  font-size: 12px;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  line-height: 1.4;
  font-weight: 700;
}

.mp-foot {
  padding: 12px 18px 18px;
  border-top: 1px solid #eef0f6;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.mp-btn {
  padding: 11px 16px !important;
  border-radius: 12px !important;
  border: 1px solid #d8dbe7 !important;
  background: #fff !important;
  color: #111 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  cursor: pointer;
}
.mp-btn.primary {
  background: #2563eb !important;
  color: #fff !important;
  border-color: #2563eb !important;
}
.mp-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.mp-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 7px 12px !important;
  border-radius: 999px !important;
  border: 1px solid #dbeafe !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  cursor: pointer;
  max-width: 100%;
  width: auto !important;
}
.mp-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-chip.mp-chip--compact {
  padding: 5px 10px;
  font-size: 11px;
  gap: 5px;
  max-width: min(220px, 70vw);
}
.mp-chip.mp-chip--compact .mp-chip-swap {
  opacity: 0.8;
  font-size: 12px;
  flex: 0 0 auto;
}

@media (max-width: 520px) {
  .mp-overlay { padding: 0; align-items: stretch; }
  .mp-panel {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  .mp-map, .mp-list { max-height: calc(100vh - 280px); }
}
