  :root{
    --sidebar-w: 280px;
    --header-h: 52px;
    /* --border: #1f2937; */
    --panel-bg: #ffffff;
    --shadow: 0 8px 24px rgba(0,0,0,.18);

    --leftW: 280px;
    --rightW: 320px;
    --border: #d9d9d9;
    --bg: #fff;
    --blue: #1e73c9;
  }


html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* PC(1080px以上)：左パネル幅の右側にズームボタンを出す */
@media (min-width:1080px){
  /* Leafletの左上コントロール全体を右へ */
  .leaflet-top.leaflet-left {
    left: var(--leftW);
  }

  /* 少し余白を付けたい場合 */
  .leaflet-top.leaflet-left .leaflet-control {
    margin-left: 10px;
    margin-top: 10px;
  }
}
/* 地図の表示 */
.leaflet-top, .leaflet-bottom { z-index: 9999; }
/* ズーム等（左上コントロール群） */
#map .leaflet-top.leaflet-left {
  top: var(--ctrl-top) !important;
}

/* もしズームだけ動かしたいなら（任意） */
#map .leaflet-control-zoom {
  margin-top: 0; /* 余計なマージンがある場合の調整 */
}

.page-frame {
  border: none; 
  margin: 0;
  /* height: 100vh; */
  /* width: 100vw; */
}
/* ===== レイアウト ===== */
  .layout{
    position:relative;
    display:flex;
    height:100vh;
    width:100%;
    background:#f6f6f6;
    border-top: 5px solid #20b97b;
    box-sizing: border-box;
  }

/* ===== サイドバー ===== */
.sidebar {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w, 280px);
  max-width: 86vw;
  background: var(--panel-bg);
  border-right: 2px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  z-index: 40;
  /* ★ 左からスライド */
  transform: translateX(-100%);
  transition: transform .25s ease;
}
.sidebar-header{
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
}

.btn-close{
  width: 34px;
  height: 34px;
  border: 2px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-body{
  padding: 10px 12px 14px;
  overflow: auto;
}

.sidebar-body h3{
  font-size: 13px;
  margin: 0 0 8px;
  color: #111827;
}

.field{ margin: 10px 0; }

.field label{
  display:block;
  font-size: 12px;
  margin-bottom: 6px;
  color:#111827;
}

.field select,
.field input{
  width: 100%;
  height: 34px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0 10px;
  box-sizing: border-box;
  background: #fff;
}

/* ===== 地図領域 ===== */
.map-wrap{
  flex: 1;
  position: relative;
  background: #f3f4f6;
  z-index: 10;
}

/* 実際は地図ライブラリに置換 */
#map{
  position: absolute;
  inset: 0;
}

/* ===== 開閉ボタン（サイドバーが閉のときに見せる） ===== */
.btn-open .arrow{
  font-weight: 700;
}

/* ===== 背面マスク（スマホ時にサイドバー開で表示） ===== */
.backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 15;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.backdrop.is-active{
  opacity: 1;
  pointer-events: auto;
}

/* =========================
   状態クラス（JSで付け外し）
   ========================= */

.is-closed .sidebar {
  transform: translateX(-100%);
}

/* 閉じているときだけ表示 */
.is-closed .btn-open {
  display: inline-flex;
}

/* Leafletズームコントロール位置調整 */
.leaflet-top.leaflet-left {
  top: 56px;   /* ← 検索条件ボタンの下 */
}
/* ====== PC（1080px以上） ====== */
@media (min-width: 1080px){
  /* PCはサイドバーが常にレイアウト内 */
  .backdrop{ display:none; }
}

/* 全体 */
.search-block {
  width: 100%;
  /* font-family: sans-serif; */
}

/* ラベル */
.search-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #111827;
}

/* 入力＋ボタンの枠 */
.search-box {
  display: flex;
  align-items: stretch;
}

/* テキスト入力 */
.search-input {
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-right: none;
  border-radius: 6px 0 0 6px;
  outline: none;
}

/* プレースホルダ色 */
.search-input::placeholder {
  color: #aaa;
}

/* フォーカス時 */
.search-input:focus {
  border-color: #1e88e5;
}

/* 検索ボタン */
.search-button {
  width: 48px;
  background-color: #1e88e5;
  color: #fff;
  border: 1px solid #1e88e5;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-size: 16px;
}

/* ホバー */
.search-button:hover {
  background-color: #1565c0;
}
  #keywordBtn svg{ width:18px; height:18px; fill:#fff; }
  #keywordBtn{
    width:44px;
    border:none;
    border-radius:0 6px 6px 0;
    background:#1e73c9;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
  }
/* 左（検索条件） */
  #leftPanel{
    width:280px;
    background:#fff;
    border-right:1px solid #d9d9d9;
    box-sizing:border-box;
    display:flex;
    flex-direction:column;
    z-index:40;
  }
  .leftHeader{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:10px 10px;
    border-bottom:1px solid var(--border);
    background:#fff;
  }
  .leftHeader .leftArea{
    display:flex;
    align-items:center;
    gap:8px;
  }
  #leftCloseBtn {
    display: none;
  }

  @media (max-width: 1079px) {
    #leftCloseBtn {
      display: inline-flex;
    }
  }

/* 右（一覧/詳細） */
  #rightPanel{
    width:320px;
    background:#fff;
    border-left:1px solid #d9d9d9;
    box-sizing:border-box;
    display:flex;
    flex-direction:column;
    z-index:40;
  }
  .rightHeader{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:10px 10px;
    border-bottom:1px solid var(--border);
    background:#fff;
  }
  .rightHeader .leftArea{
    display:flex;
    align-items:center;
    gap:8px;
  }
  .btn{
    border:1px solid var(--border);
    background:#fff;
    padding:6px 10px;
    border-radius:6px;
    cursor:pointer;
    font-size:12px;
  }
  .btn:hover{ background:#f5f5f5; }
  .btnX{
    width:28px;
    height:28px;
    border:1px solid var(--border);
    background:#fff;
    border-radius:6px;
    cursor:pointer;
    font-size:16px;
    line-height:26px;
  }
  .btnX:hover{ background:#f5f5f5; }

  #rightBody{
    overflow:auto;
    padding:0;
    flex:1;
  }


#howtoBtn {
  display: none;
}
/* スマホ表示 */
@media (max-width: 1079px) {
  #howtoBtn {
    display: block;/* 初期はJSで制御 */
    position: fixed;
    top: 12px;
    left: 100px;
    z-index: 1000;
    padding: 10px 14px;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,.25);
  }
}

/* デフォルトは非表示 */
#openRightBtn {
  display: none;
}

/* スマホ表示 */
@media (max-width: 1079px) {
  #openRightBtn {
    display: none; /* 初期はJSで制御 */
    position: fixed;
    top: 12px;
    left: 150px;
    z-index: 1000;

    padding: 10px 14px;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,.25);
  }
}

  /* 一覧 */
  .listItem{
    border-bottom:1px solid var(--border);
    padding:10px 12px;
    background:#fff;
  }
  .phNameBtn{
    display:inline-block;
    border:none;
    background:transparent;
    padding:0;
    margin:0;
    cursor:pointer;
    color:#000;
    font-weight:700;
    text-decoration:underline; /* 「リンク風」だが a ではない */
    font-size:14px;
  }
  .phAddr{
    margin-top:4px;
    font-size:12px;
    color:#555;
    line-height:1.4;
  }
  .navLink{
    display:inline-block;
    margin-top:6px;
    font-size:12px;
    color:var(--blue);
    text-decoration:underline;
  }
  .moreWrap{
    padding:12px;
    background:#fff;
  }
  .moreBtn{
    width:100%;
    border:1px solid var(--border);
    background:#fff;
    padding:10px;
    border-radius:6px;
    cursor:pointer;
  }
  .moreBtn:hover{ background:#f5f5f5; }

  /* 詳細 */
  .detailBox{
    padding:14px;
    background:#fff;
  }
  .detailTitle{
    font-size:16px;
    font-weight:800;
    margin:6px 0 4px;
  }
  .detailAddr{ font-size:14px; color:#555; margin-bottom:10px; }
  .detailSection{ margin-top:14px; }
  .detailLabel{ font-size:14px; font-weight:700; margin-bottom:6px; }
  .kv{ font-size:14px; line-height:1.5; color:#333; }
  .hourText{
    font-size:14px;
    padding: 0 10px;
    line-height:1.5;
    color:#333;
  }

#rightCloseBtn {
  display: none;
}

@media (max-width: 1079px) {
  #rightCloseBtn {
    display: inline-flex;
  }
}

/* ====== SPレイアウト（1080px未満） ====== */
@media (max-width: 1079px){
  .layout{ display:block; }
  #leftPanel{
    position:absolute;
    left:0; top:0;
    width:85vw;
    max-width:360px;
    height:100vh;
    z-index:2000;
    transform:translateX(-100%);
    transition:transform .2s ease;
    box-shadow:2px 0 10px rgba(0,0,0,.15);
  }
  #leftPanel.open{ transform:translateX(0); }

  #rightPanel{
    position:absolute;
    right:0; top:0;
    width:85vw;
    max-width:420px;
    height:100vh;
    z-index:2000;
    transform:translateX(100%);
    transition:transform .2s ease;
    box-shadow:-2px 0 10px rgba(0,0,0,.15);
  }
  #rightPanel.open{ transform:translateX(0); }  /* 初期の位置に戻す */

  #mapWrap{ height:100vh; }
  #map{ height:100vh; }

  /* SP上部ボタン（検索条件 >>） */
  #spTopBar{
    position:absolute;
    left:10px; top:10px;
    z-index:2500;
    display:flex;
    gap:8px;
  }
  .spTopBtn{
    border:1px solid var(--border);
    background:#fff;
    padding:8px 10px;
    border-radius:6px;
    cursor:pointer;
    font-size:12px;
  }
}

/* PCではSPトップバー非表示 */
@media (min-width:1080px){
  #spTopBar{ display:none; }
}


/* 自作マーカーにシャドウをつけるためのCSS */
.custom-shadow {
    /* filter: drop-shadow(水平方向 垂直方向 ぼかし 半透明度) */
    filter: drop-shadow(4px 4px 3px rgba(0, 0, 0, 0.4));
}





#mobileTopBar { display:none !important; }
#desktopControls { display:flex !important; }
/* スマホ表示 */
@media (max-width: 1079px) {
  #desktopControls { display:none !important; }
  #mobileTopBar { display:flex !important; }
}

/* スマホ上部バー */
#mobileTopBar{
  position: fixed;
  top: 12px;
  left: 6px;
  right: 6px;
  z-index: 1000;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
  pointer-events: auto;
}
#mobileTopBar .mBtn{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #cfcfcf;
  background: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0,0,0,.12);

}
#mobileTopBar .mBtn .btnIcon{
  width: 16px;
  height: 16px;
  display: inline-block;
}
/* PC用：左サイドバーの右側に置くコントロール */
#desktopControls{
  position: absolute;
  left: 20px; /* ← 左サイドバー右端からの位置 */
  top: 12px;
  z-index: 1000;
  display:none;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
}
#desktopControls .dBtn{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #cfcfcf;
  background: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0,0,0,.12);
  width: 100px;
  /* text-align: center; */
}
#desktopControls .dBtn .btnIcon{
  width: 16px;
  height: 16px;
  display: inline-block;
}
#desktopControls .howtoRow .dBtn:hover {
  background-color: #f5f5f5;
}
#desktopControls .zoomBox{
  display:flex;
  flex-direction: column;
  gap: 0px;
  align-items: stretch;
}
#desktopControls .zoomBox .zoomInBtn{
  width:30px;
  height: 50px;
  border: 1px solid #cfcfcf;
  background: #fff;
  border-radius: 6px 6px 0 0;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0,0,0,.12);
}
#desktopControls .zoomBox .zoomOutBtn{
  width:30px;
  height: 50px;
  border: 1px solid #cfcfcf;
  background: #fff;
  border-radius: 0 0 6px 6px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0,0,0,.12);
}
#desktopControls .zoomInBtn:hover,
#desktopControls .zoomOutBtn:hover {
  background-color: #f5f5f5;
}

#desktopControls .howtoRow{
  display:flex;
  gap: 10px;
}

.certIcon {
  width: 20px;
  height: 20px;
  margin-right: 6px;
  vertical-align: middle;
}
