.map-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
}

.map-side {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  position: sticky;
  top: 18px;
}

.map-side h4 {
  margin: 0 0 10px;
}

.map-tools {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.map-tools button,
.map-tools select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--primary);
  padding: 9px 10px;
  font-weight: 800;
  cursor: pointer;
}

.map-record-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.map-record-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: #f7f9fc;
}

.map-record-card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.map-record-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.pin-status {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 900;
  color: #64748b;
}

.pin-status.ok {
  color: #16a34a;
}

.map-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 18px 44px rgba(23,32,51,.06);
}

.map-title-band {
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: #f00000;
  margin-bottom: 12px;
  letter-spacing: .06em;
}

.map-canvas {
  width: 100%;
  height: 650px;
  border: 1px solid #111;
  background: #eef2f7;
  border-radius: 8px;
  overflow: hidden;
}

.case-map-tooltip {
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(0,0,0,.45);
  border-radius: 8px;
  padding: 6px 8px;
  color: #111;
  font-size: 11px;
  line-height: 1.45;
  box-shadow: none;
  min-width: 150px;
}

.case-map-tooltip .map-label-title {
  font-weight: 900;
  font-size: 12px;
  margin-bottom: 3px;
  color: #1f2f5d;
}

.leaflet-tooltip.case-tooltip-shell {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.leaflet-tooltip.case-tooltip-shell::before {
  display: none;
}

.map-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  margin-top: 10px;
}

@media (max-width: 1100px) {
  .map-layout {
    grid-template-columns: 1fr;
  }
}

.movable-label-wrapper {
  background: transparent;
  border: none;
}

.label-size-box {
  position: relative;
  display: inline-block;
}

.movable-map-label {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0,0,0,0.45);
  border-radius: 8px;
  padding: 6px 8px;
  color: #111;
  font-size: inherit;
  line-height: 1.45;
  box-shadow: none;
  cursor: move;
  user-select: none;
  overflow: hidden;
}

.movable-map-label .area-line {
  color: red;
  font-size: 1.1em;
  font-weight: 900;
}

.movable-map-label.target-label {
  border-color: #0070c0;
}

.movable-map-label.target-label .area-line {
  color: #0070c0;
}

.label-resize-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #1f2f5d;
  border-radius: 3px;
  cursor: nwse-resize;
  z-index: 9999;
}