.map-wrap {
    position: relative;
    width: 100%;
    height: calc(100vh - 100px);
    overflow: hidden;
    isolation: isolate;
}

#map {
    width: 100%;
    height: 100%;
}

.leaflet-top.leaflet-left {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: auto;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 6px;
    padding: 8px;
    box-sizing: border-box;
    z-index: 2001;
}

.map-search-control {
    position: absolute;
    top: 10px;
    left: 60px;
    width: clamp(350px, 30%, 600px);
    max-width: calc(100% - 70px);
    z-index: 1;
}

.map-search-inner {
  position: relative;
  width: 100%;
  height: 45px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

#keyword-input {
    width: 100%;
    height: 100%;
    padding: 8px 40px 8px 10px;
    border: 1px solid #ccc;
    font-size: 16px;
    box-sizing: border-box;
}

.map-search-btn {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.map-search-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.map-capsule-group {
  margin-top:10px;
  display: flex;
  gap: 6px;
  width: 100%;
}

/* カプセルボタン本体 */
.map-capsule-btn {
/*  flex: 1;*/
  flex: 1 1 auto;
  width: auto;
  padding: 6px 15px;
  background: #ffffff;
  border: none;
  outline: none;
  border-radius: 80px;
  color : #111;
  font-size: clamp(12px, 1vw, 13px);
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.8);

  -webkit-appearance: none;
  appearance: none;
}

.map-capsule-btn:focus {
  outline: none;
}

/* 押した時 */
.map-capsule-btn:active {
  background: #e6f7ff;
}

.map-capsule-btn.is-active{
  background: #DFF0FF;
}

.map_menu {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(20px, 3vw, 50px);

    width: clamp(280px, 25%, 600px);
    /*min-width: 180px;*/
    height: 80px;
    padding: 5px;
    box-sizing: border-box;

    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 1500;
}

.map_menu > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;

    font-size: clamp(12px, 1vw, 14px);
    padding: 5px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}

.map_menu img {
    width: clamp(22px, 2.5vw, 35px);
    height: 30px;
    object-fit: contain;
}

.map_menu .runp_btn img {
    width: clamp(35px, 4vw, 55px);
    height: 35px;
    object-fit: contain;
}

.map_menu .runp_btn.is-active-p,
.map_menu .loc_btn.is-active-l
{
  background: #DFF0FF;
  border-radius: 80px;
}

.map_menu img {
  width: 35px;
  object-fit: contain;

}

.map_menu .runp_btn img {
  width: 55px;
  object-fit: contain;

}

/* 下部メニュー関連 */
.bottom-sheet {
    position: absolute;
    left: 50%;
    right: auto;
    bottom: 0;

    width: 60%;
    max-width: 700px;
    max-height: 70%;

    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.25);
    z-index: 2000;

    transform: translate(-50%, 100%);
    transition: transform 0.25s ease;

    display: flex;
    flex-direction: column;
}

.bottom-sheet.show {
    transform: translate(-50%, 0);
}

.bottom-sheet-backdrop {
    position: absolute;
    inset: 0;
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.bottom-sheet-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet-header {
  position: relative;
  display: flex;
  align-items: center;
  padding: 8px 5px 8px 12px;
  border-bottom: 1px solid #ddd;
  box-sizing: border-box;
}

.bottom-sheet-header .bottom-sheet-title {
  flex: 1;
  text-align: center;
  line-height: 1.4;
  padding: 10px 0;
}

.bottom-sheet-title .main-title{
  font-size: 16px;
  font-weight: bold;
}

.bottom-sheet-title .sub-title{
  font-size: 10px;
}

.bottom-sheet-close {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);

  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #cccccc;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);

  cursor: pointer;
  padding: 0;
  z-index: 2;

  color: transparent;
}

.bottom-sheet-close::before,
.bottom-sheet-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  height: 4px;
  background: #ffffff;
  transform: translate(-50%, -50%) rotate(45deg);
}

.bottom-sheet-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}


.bottom-sheet-body {
  padding: 20px 10px 15px 10px;
}

.bottom-sheet-body p
{
    text-align: center;
    font-weight: bold;
    margin-top: 0px;
}

.bottom-sheet-body label {
  display: flex; 
/*  align-items: flex-start;*/
  align-items: center;
/*  gap: 8px;*/
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 10px;
}

.bottom-sheet-body-area
{
    text-align: center;
    padding: 50px 10px 50px 10px;
}

.bottom-sheet-body-area p
{
    text-align: center;
    font-weight: bold;
    margin-top: 0px;
}

.bottom-sheet-body-area label {
  display: flex; 
  align-items: center;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 10px;
}

.bottom-sheet-body,
.bottom-sheet-body-area {
    overflow-y: auto;
    min-height: 0;
}

.grid-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
/*  column-gap: 16px;*/
  row-gap: 8px;
  margin-top: 10px;
  margin-bottom: 15px;
}

.grid-items label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.grid-items-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
/*  column-gap: 16px;*/
  row-gap: 8px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.grid-items-3 label {
  display: flex;
  align-items: center;
/*  gap: 8px;*/
  cursor: pointer;
}

#region-select {
  width: 70%;
  padding: 12px 14px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;

  height: 48px;
}

/* スマートフォン表示 */
@media screen and (max-width: 768px) {
    .map-search-control {
        top: 10px;
        left: 60px;
        width: calc(100% - 70px);
        max-width: none;
        min-width: 0;
    }

    .map-capsule-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .map_menu {
        width: 60%;
        min-width: 0;
        height: 65px;
        bottom: 20px;
        gap: 50px;
    }

    .map_menu > div {
        font-size: 11px;
        padding: 3px;
    }

    .map_menu img {
        width: 25px;
    }

    .map_menu .runp_btn img {
        width: 35px;
    }
    
    .bottom-sheet {
        width: 100%;
        max-width: none;
        max-height: 80%;
    }
    
    .leaflet-left .leaflet-control {
        margin-left: 0px;
    }
}

/* --- 施設写真ピン（background-image 方式）--- */
.leaflet-div-icon {
    background: transparent; 
    border: none; 
}

.custom-marker-icon {
  background: transparent !important;
  border: none !important;
}

.custom-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.custom-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: #d33 center/cover no-repeat; /* 未読込時は赤丸 */
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.custom-label {
  font: 13px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans JP", sans-serif;
  color: #111; background: rgba(255,255,255,0.92);
  padding: 2px 8px; border-radius: 6px; white-space: nowrap;
  max-width: 200px; text-overflow: ellipsis; overflow: hidden;
  pointer-events: none; box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

.marker-cluster-small { background: rgba(51,136,255,.6); }
.marker-cluster-small div { background: rgba(51,136,255,.8); color: #fff; }
.marker-cluster-medium { background: rgba(255,166,0,.6); }
.marker-cluster-medium div { background: rgba(255,166,0,.85); color: #111; }
.marker-cluster-large { background: rgba(232,67,53,.6); }
.marker-cluster-large div { background: rgba(232,67,53,.85); color: #fff; }

.leaflet-div-icon {
  background: transparent !important;
  border: none !important;
  box-shadow: none;
}

.custom-cluster-icon {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
}



/*現在地*/
.u-user-location {
  width: 18px;
  height: 18px;

  background: #1e90ff;
  border: 3px solid #ffffff;
  border-radius: 50%;

  box-shadow: 
      0 0 0 3px rgba(30,144,255,0.5),
      0 0 8px rgba(30,144,255,0.9);

  animation: pulse 2s infinite ease-out;
}

.leaflet-marker-pane {
    will-change: transform;
}

/* ズーム中だけクラスタ画像を非表示 */
#map.cluster-zooming .cluster-photo {
    visibility: hidden;
}