html, body { 
  height: 100%; 
  margin: 0; 
  font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
  overflow: hidden;
}
#map { 
  height: 100%; 
  width: 100%; 
  position: absolute;
  top: 0;
  left: 0;
}

/* 検索行コンテナ（検索ボックス + 言語選択を横並び） */
#searchRow {
  position: absolute;
  top: 12px;
  left: 412px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: left 0.3s ease-in-out;
}
#searchRow.menu-closed {
  left: 12px;
}

/* 検索ボックス */
#searchBox{
  display: flex;
  gap: 4px;
  background: white;
  padding: 6px;
  border-radius: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  width: 340px;
  box-sizing: border-box;
  overflow: visible;
}
#searchInput{
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#searchButton{
  padding: 8px 16px;
  background: #009D96;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
  flex: 0 0 auto;
}
#searchButton:hover{
  background: #007a75;
}

/* 言語選択（検索ボックスの右横） */
#ui{
  background: rgba(255,255,255,0.95);
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
#ui label{
  font-size: 12px;
  color: #333;
  font-weight: 600;
}
#langSelect{
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #999;
  background: #fff;
  outline: none;
}

/* レイヤーボタン（右上単独） */
#layerBtn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.97);
  border: 2px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 4px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
#layerBtn:hover {
  border-color: #009D96;
  box-shadow: 0 2px 10px rgba(0,157,150,0.3);
}
#layerBtn.active {
  border-color: #009D96;
  background: #e6f7f7;
}
#layerBtn img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
#layerBtnLabel {
  font-size: 10px;
  font-weight: 700;
  color: #333;
  line-height: 1;
}

/* レイヤーパネル（レイヤーボタンの左側・上端揃え） */
#layerPanel {
  position: absolute;
  top: 12px;       /* レイヤーボタンと上端を揃える */
  right: 80px;     /* layerBtn(56px) + gap(12px) + border(12px) */
  z-index: 9998;
  width: 220px;
  background: rgba(255,255,255,0.97);
  border: 2px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  padding: 12px 10px;
  display: none;
  overflow-y: auto;
  max-height: calc(100vh - 30px);
}
#layerPanel.show {
  display: block;
}

/* 地図コントロールボタン (現在地、全画面) */
.map-control-btn{
  position: absolute;
  left: 412px; /* 左メニュー(400px) + margin(12px) */
  width: 40px;
  height: 40px;
  background: white;
  border: 2px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 9997;
  transition: left 0.3s ease-in-out, bottom 0.2s;
}
.map-control-btn.menu-closed{
  left: 12px; /* メニュー閉じている時は左端 */
}
.map-control-btn:hover{
  border-color: #009D96;
  box-shadow: 0 2px 8px rgba(0,157,150,0.3);
}
.map-control-btn img{
  width: 24px;
  height: 24px;
  object-fit: contain;
}

#currentLocationBtn{
  bottom: 80px;
  display: none; /* PC版では非表示 */
}
#fullscreenBtn{
  bottom: 32px;
}

/* スケールバー（DOM表示）: 全画面ボタンの下 */
#scaleBarDom{
  position: absolute;
  left: 412px;          /* メニューopen時 */
  bottom: 4px;          /* 全画面ボタン(bottom:32px)の下に収める */
  z-index: 9997;
  background: rgba(255,255,255,0.95);
  border: 2px solid #ccc;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  color: #333;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  pointer-events: none; /* クリック邪魔しない */
  transition: left 0.3s ease-in-out;
  min-width: 40px;
  text-align: center;
}
#scaleBarDom.menu-closed{
  left: 12px;           /* メニューclose時 */
}

/* 左側メニュー ラッパー（パネル + Closeボタンを一体でスライド） */
#leftPanelWrapper {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  z-index: 9998;
  display: flex;
  align-items: center;
  pointer-events: none; /* ラッパー自体は地図クリックをブロックしない */
  transition: transform 0.3s ease-in-out;
}
#leftPanelWrapper.hidden {
  transform: translateX(-400px);
}

/* 左側メニューパネル */
#leftPanel{
  position: relative;
  width: 400px;
  height: 100%;
  background: rgba(255,255,255,0.95);
  border-right: 2px solid #ccc;
  overflow: hidden;
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
  pointer-events: auto;
  align-self: stretch;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

/* 左パネルヘッダー（ルート） */
.panel-header {
  padding: 12px 8px;
  background: #009D96;
  color: white;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  border-bottom: 2px solid #007a75;
}

/* ルートコンテンツ */
#routeContent {
  padding: 12px 8px;
}

/* メニュー開閉ボタン */
.menu-toggle-btn{
  position: absolute;
  padding: 10px 6px;
  background: white;
  border: 2px solid #ccc;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 700;
  color: #666;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 10001; /* 左メニューやMapより前面に */
  writing-mode: vertical-rl;
  text-orientation: upright;
  min-height: 60px;
}
.menu-toggle-btn:hover{
  background: #f0f0f0;
  border-color: #009D96;
}

/* closeボタン（ラッパー内でパネルの右側に自然に配置） */
#menuCloseBtn{
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: none; /* 左パネルと一体化させる見た目調整 */
  pointer-events: auto;
  align-self: center;
}

/* openボタン（画面左側中央） */
#menuOpenBtn{
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  z-index: 10001;
  pointer-events: auto;
}

/* description-box */
/* セクション */
.menu-section{
  margin-bottom: 16px;
}
.section-title{
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #ddd;
}

/* layerPanel 内の icon-button 調整 */
#layerPanel .icon-button {
  min-height: 75px;
  padding: 6px 3px;
}
#layerPanel .icon-button img {
  width: 42px;
  height: 42px;
}

/* ハザード情報（4列）：アイコンを小さく */
#hazardGrid .icon-button {
  min-height: 62px;
  padding: 5px 2px;
  min-width: 0;
}
#hazardGrid .icon-button img {
  width: 30px;
  height: 30px;
}
#hazardGrid .icon-button-label {
  font-size: 10px;
  overflow-wrap: break-word;
  word-break: break-word;
  width: 100%;
}

/* 多言語病院（3列）：アイコンをやや小さく */
#hospitalGrid .icon-button {
  min-height: 68px;
  padding: 5px 2px;
}
#hospitalGrid .icon-button img {
  width: 36px;
  height: 36px;
}
#hospitalGrid .icon-button-label {
  font-size: 10px;
}

/* アイコンボタングリッド（デフォルト：2列） */
.icon-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ハザード情報：4列 */
#hazardGrid {
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

/* 多言語病院：3列 */
#hospitalGrid {
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.icon-button{
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  background: white;
  border: 2px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 85px;
}
.icon-button:hover{
  border-color: #009D96;
  box-shadow: 0 2px 6px rgba(0,157,150,0.2);
}
.icon-button.active{
  border-color: #009D96;
  background: #e6f7f7;
}

/* ================================
   ハザード情報：選択色を赤に変更
   ================================ */
#hazardGrid .icon-button.active{
  border-color: #e53935;     /* 枠線：赤 */
  background: #fdecea;       /* 背景：薄赤 */
}

/* ホバー色も赤系にしたい場合 */
#hazardGrid .icon-button:hover{
  border-color: #e53935;
  box-shadow: 0 2px 6px rgba(229,57,53,0.25);
}

.icon-button img{
  width: 50px;
  height: 50px;
  object-fit: contain;
  margin-bottom: 4px;
}
.icon-button-label{
  font-size: 11px;
  color: #333;
  text-align: center;
  line-height: 1.3;
}

/* 注釈テキスト */
.note-text{
  font-size: 10px;
  color: #666;
  line-height: 1.4;
  margin-top: 8px;
  padding-left: 4px;
}

/* 凡例パネル (右下) */
#legendPanel{
  position: absolute; 
  bottom: 40px; /* コピーライト(©ZENRIN)と被らないよう上げる */
  right: 56px; /* ズームボタン(約44px) + 余白 で被りを回避 */
  z-index: 9999;
  background: white;
  border: 2px solid #333;
  border-radius: 6px;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  display: none;
  max-width: 520px; /* sediment-legend最大幅490px + padding 12px×2 */
}
#legendPanel.show{
  display: block;
}
.legend-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f0f0f0;
  padding: 8px 12px;
  border-bottom: 1px solid #ccc;
}
.legend-title{
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
.legend-close{
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
}
.legend-close:hover{
  color: #000;
}
.legend-content{
  padding: 12px;
}
.legend-content img{
  max-width: 100%;
  height: auto;
  display: block;
}

.sediment-legend{
  width: 330px; /* 日本語・中国語デフォルト */
  height: 165px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 言語別横幅 */
#sedimentLegend[data-lang="en"]    { width: 460px; }
#sedimentLegend[data-lang="zh-TW"] { width: 330px; }
#sedimentLegend[data-lang="ko"]    { width: 370px; }
#sedimentLegend[data-lang="pt"]    { width: 490px; }

.sediment-legend-table{
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 10px;
  color: #333;
  flex-shrink: 0;
}

.sediment-legend-table th,
.sediment-legend-table td{
  border: 1px solid #bdbdbd;
  padding: 6px 4px;
  text-align: center;
  vertical-align: middle;
  word-break: break-word;
  line-height: 1.25;
}

.sediment-legend-table thead th{
  background: #808080;
  color: #ffffff;
  font-weight: 700;
}

.sediment-legend-table tbody th{
  background: #fafafa;
  font-weight: 600;
}

.sediment-legend-table th:first-child{
  width: 44%;
}

.sediment-legend-table th:nth-child(2),
.sediment-legend-table th:nth-child(3),
.sediment-legend-table td{
  width: 28%;
}

/* ポルトガル語：ヘッダー文字を小さくしてÁrea de Alerta Especialを1行に収める */
#sedimentLegend[data-lang="pt"] .sediment-legend-table thead th{
  font-size: 8.5px;
}

.legend-cell-special{
  background: #f5b5b0;
}

.legend-cell-alert{
  background: #fff2b3;
}

/* 説明文エリア共通 */
.sediment-legend-desc {
  margin-top: 6px;
  font-size: 8px; /* 英語・ポルトガル語デフォルト */
  color: #444;
  line-height: 1.3;
  overflow: hidden;
  flex-shrink: 1;
}

/* 日本語・中国語：文字を大きく */
#sedimentLegend[data-lang="ja"]    .sediment-legend-desc,
#sedimentLegend[data-lang="zh-TW"] .sediment-legend-desc {
  font-size: 10px;
  line-height: 1.4;
}

/* 韓国語：やや小さめで収める */
#sedimentLegend[data-lang="ko"]    .sediment-legend-desc {
  font-size: 8.5px;
  line-height: 1.3;
}


.sediment-legend-desc p {
  margin: 0 0 2px 0;
  padding: 0;
}

/* dottedNoteとspecialDescの間に空白を追加 */
.sediment-legend-desc p:first-child {
  margin-bottom: 4px;
}

/* 英語・ポルトガル語：説明文を10pxに変更 */
#sedimentLegend[data-lang="en"] .sediment-legend-desc,
#sedimentLegend[data-lang="pt"] .sediment-legend-desc {
  font-size: 10px;
  line-height: 1.4;
}

/* 英語・韓国語は余白を抑えてより多くテキストを収める */
#sedimentLegend[data-lang="en"] .sediment-legend-desc p:first-child,
#sedimentLegend[data-lang="ko"] .sediment-legend-desc p:first-child {
  margin-bottom: 3px;
}
#sedimentLegend[data-lang="en"] .sediment-legend-desc,
#sedimentLegend[data-lang="ko"] .sediment-legend-desc {
  margin-top: 4px;
}

/* ハザードレイヤーコンテナ */
#hazardLayerContainer{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

/* スクロールバーのスタイル */
#leftPanel::-webkit-scrollbar { display: none; }

/* レスポンシブ: スマホ対応 */
@media (max-width: 768px){
  #searchRow{
    left: 70px;
  }
  #searchRow.menu-closed{
    left: 70px;
  }
  #searchBox{
    width: 200px;
  }
  #searchInput{
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }
  #ui {
    display: none; /* スマホでは言語選択を非表示（スペース節約） */
  }
  #currentLocationBtn {
    display: flex; /* スマホ版では現在地ボタンを表示 */
  }
  #leftPanel{
    width: 280px;
  }
  /* スマホのときはラッパーのスライド量も調整 */
  #leftPanelWrapper.hidden{
    transform: translateX(-280px);
  }
}

/* カスタムズームボタンは廃止。SDK標準のZoomButtonを右下に配置 */
/* ZENRINのズームボタンをコピーライトと被らないよう上に移動 */
.zwgl-ctrl-group.zwgl-ctrl-bottom-right {
  bottom: 35px !important;
}
/* ===================================================
   検索候補リスト
   =================================================== */
#searchSuggestions {
  position: absolute;
  top: calc(100% + 6px); /* searchBox直下 */
  left: 0;
  width: 100%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  z-index: 10000;
  overflow: hidden;
  box-sizing: border-box;
}
.suggestion-header {
  padding: 8px 16px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #009D96;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.suggestion-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}
.suggestion-item:last-child {
  border-bottom: none;
}
.suggestion-item:hover,
.suggestion-item.active {
  background: #e6f5f5;
}
.suggestion-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: #009D96;
  fill: #009D96;
}
.suggestion-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.suggestion-main {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggestion-sub {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggestion-no-result {
  padding: 12px 16px;
  font-size: 13px;
  color: #888;
  text-align: center;
}
/* ===================================================
   ルート検索UI
   =================================================== */

/* 移動手段ボタン行 */
#routeModeRow {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  padding: 8px 8px 0;
}

/* ルート操作ヒント */
.route-hint-text {
  font-size: 11px;
  color: #888;
  padding: 0 10px 8px;
  line-height: 1.5;
}
.route-mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  background: white;
  border: 2px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: #555;
  transition: all 0.2s;
}
.route-mode-btn:hover {
  border-color: #009D96;
}
.route-mode-btn.active {
  border-color: #009D96;
  background: #e6f7f7;
  color: #009D96;
}
.route-mode-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* 入力行 */
.route-input-row {
  display: flex;
  align-items: center;
  padding: 0 8px;
  margin-bottom: 4px;
}
.route-dot {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
}
.start-dot { background: #2E7D32; }  /* スタート:緑 */
.goal-dot  { background: #e53935; }  /* ゴール:赤 */

/* 入力フィールド＋×ボタンのラッパー */
.route-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.route-input {
  flex: 1;
  padding: 7px 30px 7px 10px;  /* 右に×ボタン分の余白 */
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 12px;
  outline: none;
  min-width: 0;
  font-family: inherit;
  width: 100%;
}
.route-input:focus {
  border-color: #009D96;
  box-shadow: 0 0 0 2px rgba(0,157,150,0.15);
}

/* ×クリアボタン */
.route-input-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 12px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  visibility: hidden;
}
.route-input-clear.visible {
  visibility: visible;
}
.route-input-clear:hover {
  color: #555;
  background: #f0f0f0;
}

/* 入れ替えボタン行 */
.route-swap-row {
  display: flex;
  justify-content: flex-end;
  padding: 0 8px;
  margin-bottom: 4px;
}
.route-swap-btn {
  width: 28px;
  height: 28px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  transition: all 0.2s;
  margin-right: 4px;
}
.route-swap-btn:hover {
  border-color: #009D96;
  background: #e6f7f7;
}
.route-swap-btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* 検索ボタン */
/* ルート検索ボタン行 */
.route-btn-row {
  display: flex;
  gap: 8px;
  margin: 8px 8px 0;
}

.route-search-btn {
  flex: 7;
  padding: 9px;
  background: #009D96;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.2s;
  font-family: inherit;
}
.route-search-btn:hover { background: #007a75; }
.route-search-btn:disabled {
  background: #a8d5d3;
  color: #e0f2f1;
  cursor: not-allowed;
  pointer-events: none;
}

/* ルートクリアボタン */
.route-clear-btn {
  flex: 3;
  padding: 9px;
  background: #9e9e9e;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.route-clear-btn:hover { background: #757575; }

/* 結果エリア */
.route-result {
  margin: 8px 8px 0;
  padding: 8px 10px;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 12px;
  color: #333;
  line-height: 1.6;
}
.route-result.error {
  background: #fdecea;
  color: #c62828;
}

/* 右クリックメニュー */
#mapContextMenu {
  position: fixed;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 99999;
  padding: 4px 0;
  min-width: 140px;
  display: none;
}
#mapContextMenu.show { display: block; }
.ctx-menu-item {
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  color: #222;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ctx-menu-item:hover { background: #e6f5f5; color: #009D96; }
.ctx-menu-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
/* ルート実装中バナー */
#routeImplNotice {
  background: #fff8e1;
  border-bottom: 1px solid #ffe082;
  color: #f57f17;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  padding: 5px 8px;
  letter-spacing: 0.03em;
}
/* =========================================================
   検索タブ追加スタイル
   ========================================================= */

/* パネルヘッダー：タブ形式に変更 */
.panel-header {
  display: flex !important;
  padding: 0 !important;
  text-align: unset !important;
}

.panel-tab {
  flex: 1;
  text-align: center;
  padding: 12px 6px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  user-select: none;
}

.panel-tab:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.panel-tab.active-tab {
  color: #fff;
  border-bottom-color: #fff;
  background: rgba(255,255,255,0.18);
}

/* 検索タブコンテンツ全体 */
#searchContent {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
  height: calc(100vh - 46px); /* panel-headerの高さ分引く */
}

/* 検索セクション */
.search-section {
  border-bottom: 1px solid #e8e8e8;
  flex-shrink: 0;
}

.search-section-title {
  padding: 8px 12px 6px;
  font-size: 12px;
  font-weight: 700;
  color: #009D96;
  background: #f5fafa;
  border-bottom: 1px solid #d0eceb;
}

/* 都道府県・市区町村 カスタムドロップダウンUI */
#prefList {
  padding: 8px 10px 10px;
  position: relative; /* ドロップダウンパネルの基準 */
}

/* ラッパー */
.addr-dropdown-wrapper {
  position: relative;
}

/* トリガーボタン */
.addr-dropdown-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #fff;
  border: 1.5px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: #333;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.addr-dropdown-trigger:hover {
  border-color: #009D96;
}
.addr-dropdown-trigger.open {
  border-color: #009D96;
  box-shadow: 0 0 0 2px rgba(0,157,150,0.15);
}
.addr-dropdown-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.addr-dropdown-arrow {
  font-size: 10px;
  color: #009D96;
  margin-left: 6px;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.addr-dropdown-trigger.open .addr-dropdown-arrow {
  transform: scaleY(-1);
}

/* ドロップダウンパネル本体 */
.addr-dropdown-panel {
  position: fixed;
  background: #fff;
  border: 1.5px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  z-index: 10002;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* 都道府県 ul */
.addr-pref-ul {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 400px;
  overflow-y: auto;
}
.addr-pref-li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-size: 13px;
  color: #222;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid #f0f0f0;
}
.addr-pref-li:last-child { border-bottom: none; }
.addr-pref-li:hover { background: #e6f7f7; color: #009D96; }
.addr-pref-li.selected { background: #e6f7f7; color: #009D96; font-weight: 700; }
.addr-li-label { flex: 1; }
.addr-li-arrow {
  font-size: 14px;
  color: #aaa;
  margin-left: 4px;
}
.addr-pref-li:hover .addr-li-arrow { color: #009D96; }

/* 市区町村パネル */
.addr-city-panel {
  display: flex;
  flex-direction: column;
}
.addr-city-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid #e0f0ef;
  background: #f0fafa;
}
.addr-back-btn {
  background: none;
  border: 1px solid #009D96;
  border-radius: 4px;
  color: #009D96;
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  flex-shrink: 0;
}
.addr-back-btn:hover { background: #e6f7f7; }
.addr-city-pref-name {
  font-size: 12px;
  font-weight: 700;
  color: #009D96;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.addr-city-loading,
.addr-city-error {
  padding: 10px 14px;
  font-size: 12px;
  color: #999;
}
.addr-city-error { color: #e53935; }

/* 市区町村 ul */
.addr-city-ul {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 360px;
  overflow-y: auto;
}
.addr-city-li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px 7px 22px;
  font-size: 12px;
  color: #333;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.1s;
  gap: 6px;
}
.addr-city-li:last-child { border-bottom: none; }
.addr-city-li:hover { background: #e6f7f7; color: #009D96; }
.addr-city-li.selected { background: #b2dfdb; color: #00695c; font-weight: 700; }

.addr-city-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 「移動」ボタン */
.addr-city-move-btn {
  flex-shrink: 0;
  padding: 3px 8px;
  background: #009D96;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  white-space: nowrap;
}
.addr-city-move-btn:hover  { background: #007a75; }
.addr-city-move-btn:active { background: #006060; }
.addr-city-move-btn:disabled { background: #aaa; cursor: wait; }

/* 住所ドリルダウン - 子あり項目の矢印 */
.addr-city-drill-arrow {
  flex-shrink: 0;
  font-size: 14px;
  color: #aaa;
  cursor: pointer;
  padding: 0 2px;
}

/* 住所ドロップダウン下の「移動」ボタン行 */
.addr-move-row {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  border-top: 1.5px solid #e0f0ef;
  background: #f0fafa;
  flex-shrink: 0;
}
.addr-move-btn {
  flex: 1;
  padding: 7px 10px;
  background: #009D96;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.15s;
}
.addr-move-btn:hover  { background: #007a75; }
.addr-move-btn:active { background: #006060; }

.city-loading, .city-error {
  padding: 6px 10px;
  font-size: 11px;
  color: #999;
}
.city-error { color: #e53935; }

/* =========================================================
   施設ジャンル カスタムドロップダウンUI
   ========================================================= */
#facilityList {
  padding: 8px 10px 10px;
  position: relative;
}

/* ラッパー */
.facil-dropdown-wrapper {
  position: relative;
}

/* トリガーボタン */
.facil-dropdown-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #fff;
  border: 1.5px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: #333;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.facil-dropdown-trigger:hover { border-color: #009D96; }
.facil-dropdown-trigger.open {
  border-color: #009D96;
  box-shadow: 0 0 0 2px rgba(0,157,150,0.15);
}
.facil-dropdown-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.facil-dropdown-arrow {
  font-size: 10px;
  color: #009D96;
  margin-left: 6px;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.facil-dropdown-trigger.open .facil-dropdown-arrow {
  transform: scaleY(-1);
}

/* ドロップダウンパネル本体 */
.facil-dropdown-panel {
  position: fixed;
  background: #fff;
  border: 1.5px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  z-index: 10002;
  overflow-y: auto;
}

/* 親ジャンル ul */
.facil-genre-ul {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 440px;
  overflow-y: auto;
}
.facil-genre-li {
  border-bottom: 1px solid #f0f0f0;
  cursor: default;
}
.facil-genre-li:last-child { border-bottom: none; }
.facil-genre-li.has-checked { color: #009D96; font-weight: 700; }

/* アコーディオン行（親ジャンルの1行） */
.facil-genre-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px 9px 10px;
  font-size: 13px;
  color: #222;
  transition: background 0.1s;
}
.facil-genre-row:hover { background: #f5fcfc; }
.facil-genre-li.has-checked .facil-genre-row { color: #009D96; font-weight: 700; }

/* 親チェックボックス */
.facil-parent-check {
  width: 15px;
  height: 15px;
  accent-color: #009D96;
  cursor: pointer;
  flex-shrink: 0;
}

.facil-genre-li-label {
  flex: 1;
  cursor: pointer;
  user-select: none;
}
.facil-genre-li-label:hover { color: #009D96; }

.facil-genre-li-badge {
  font-size: 10px;
  background: #009D96;
  color: #fff;
  border-radius: 10px;
  padding: 1px 6px;
  flex-shrink: 0;
  display: none;
}
.facil-genre-li.has-checked .facil-genre-li-badge { display: inline-block; }
.facil-genre-li-arrow {
  font-size: 12px;
  color: #aaa;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 2px;
  transition: transform 0.18s;
  user-select: none;
}
.facil-genre-li-arrow:hover { color: #009D96; }
.facil-genre-li-arrow.open { transform: scaleY(-1); color: #009D96; }

/* アコーディオン子ジャンルリスト */
.facil-children-ul {
  list-style: none;
  margin: 0;
  padding: 2px 0 4px 0;
  background: #fafcfc;
  border-top: 1px solid #f0f0f0;
}

/* 子ジャンルパネル */
.facil-child-panel {
  display: flex;
  flex-direction: column;
}
.facil-child-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid #e0f0ef;
  background: #f0fafa;
}
.facil-child-genre-name {
  font-size: 12px;
  font-weight: 700;
  color: #009D96;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 子ジャンル ul */
.facil-child-ul {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 180px;
  overflow-y: auto;
}
.facil-child-li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 28px;
  font-size: 12px;
  color: #333;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.1s;
  user-select: none;
}
.facil-child-li:last-child { border-bottom: none; }
.facil-child-li:hover { background: #e6f7f7; }
.facil-child-li.checked { background: #e6f7f7; color: #009D96; }
.facil-child-check {
  width: 15px;
  height: 15px;
  accent-color: #009D96;
  cursor: pointer;
  flex-shrink: 0;
}
.facil-child-name { flex: 1; }

/* 旧スタイル（互換維持） */
.genre-child-check {
  cursor: pointer;
  accent-color: #009D96;
  flex-shrink: 0;
}

/* 施設検索ボタン */
.facility-search-btn {
  padding: 9px;
  background: #009D96;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex: 7;
  transition: background 0.2s;
  font-family: inherit;
}
.facility-search-btn:hover { background: #007a75; }
.facility-search-btn:disabled {
  background: #a8d5d3;
  color: #e0f2f1;
  cursor: not-allowed;
  pointer-events: none;
}

/* 施設クリアボタン */
.facility-clear-btn {
  padding: 9px;
  background: #9e9e9e;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex: 3;
  transition: background 0.2s;
  font-family: inherit;
}
.facility-clear-btn:hover { background: #757575; }

/* 施設検索結果 */
.facility-result {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 60px;
}

.facility-result-header {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid #e0f0ef;
  z-index: 1;
}

.result-count {
  padding: 5px 12px;
  font-size: 11px;
  color: #666;
  background: #f7fafa;
  font-weight: 600;
}

.facility-result-list {
  flex: 1;
  overflow-y: auto;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.1s;
  position: relative;
}
.result-item:hover { background: #e6f7f7; }

/* 結果アイテムのツールチップ */
.result-item .result-tooltip {
  display: none;
  position: absolute;
  left: 0;
  bottom: calc(100% + 4px);
  background: rgba(50,50,50,0.92);
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: normal;
  z-index: 99999;
  pointer-events: none;
  max-width: 280px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.result-item .result-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 14px;
  border: 6px solid transparent;
  border-top-color: rgba(50,50,50,0.92);
}
.result-item:hover .result-tooltip {
  display: block;
}

/* 施設検索ボタン行（検索＋クリア） */
.facility-btn-row {
  display: flex;
  gap: 8px;
  margin: 10px 12px;
  flex-shrink: 0;
}

.result-num {
  background: #e53935;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.result-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-dist {
  font-size: 10px;
  color: #999;
  flex-shrink: 0;
}

.searching-msg, .no-results, .search-error {
  padding: 12px;
  font-size: 12px;
  color: #666;
  text-align: center;
}
.search-error { color: #e53935; }

/* POI吹き出し */
.poi-popup {
  padding: 6px 8px;
  min-width: 160px;
  max-width: 230px;
  font-size: 12px;
  font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
}

.poi-popup-name {
  font-size: 13px;
  font-weight: 700;
  color: #009D96;
  margin-bottom: 5px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 4px;
}

.poi-popup-row {
  margin-top: 3px;
  line-height: 1.5;
  color: #333;
}

.poi-popup-label {
  color: #888;
  font-size: 11px;
}

/* =========================================================
   避難所マーカー
   ========================================================= */
.shelter-marker-wrap {
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.45));
  transition: transform 0.15s;
}
.shelter-marker-wrap:hover {
  transform: translate(-50%, -50%) scale(1.15);
}
.shelter-marker-img {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  display: block;
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}

/* =========================================================
   避難所ポップアップ
   ========================================================= */
.shelter-popup {
  padding: 8px 10px;
  min-width: 170px;
  max-width: 240px;
  font-size: 12px;
  font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
}
.shelter-popup-name {
  font-size: 13px;
  font-weight: 700;
  color: #009D96;
  margin-bottom: 5px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 4px;
  line-height: 1.4;
}
.shelter-popup-row {
  margin-top: 4px;
  line-height: 1.5;
  color: #333;
}
.shelter-popup-label {
  color: #555;
  font-size: 11px;
}
.shelter-popup-note {
  color: #666;
  font-size: 11px;
}
.shelter-popup-disasters {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 5px;
}
.shelter-disaster-tag {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
  white-space: nowrap;
}

/* POI施設検索 ジャンルタグ（避難所タグと同スタイル） */
.poi-popup-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 5px;
}
.poi-genre-tag {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
  white-space: nowrap;
}

/* スクロールバー */
#searchContent::-webkit-scrollbar { width: 6px; }
#searchContent::-webkit-scrollbar-track { background: #f1f1f1; }
#searchContent::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
#facilityList::-webkit-scrollbar { width: 6px; }
.facility-result::-webkit-scrollbar { width: 6px; }
.facility-result::-webkit-scrollbar-track { background: #f1f1f1; }
.facility-result::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
/* 一般道優先チェックボックス行 */
.general-road-row {
  margin: 6px 8px 2px;
  padding: 4px 2px;
}
.general-road-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #444;
  cursor: pointer;
  user-select: none;
}
.general-road-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #1565C0;
}

/* ルート検索結果（HTML形式） */
.route-result-title {
  font-size: 13px;
  font-weight: bold;
  color: #1a237e;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #c5cae9;
}
.route-result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  padding: 3px 0;
}
.route-result-label {
  color: #666;
  white-space: nowrap;
}
.route-result-value {
  font-weight: bold;
  color: #212121;
  text-align: right;
}
/* =============================================================
   病院マーカー・ポップアップ
   ============================================================= */

/* ── 病院マーカー ── */
.hospital-marker-wrap {
  cursor: pointer;
  transform: translate(-50%, -50%);
  display: block;
}

.hospital-marker-img {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  display: block;
  pointer-events: none;
}

/* ── 病院ポップアップ ── */
.hospital-popup {
  min-width: 300px;
  max-width: 400px;
  max-height: 270px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.5;
}

.hospital-popup-name {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 4px;
  word-break: break-word;
}

.hospital-popup-category {
  font-size: 11px;
  color: #666;
  margin-bottom: 6px;
}

.hospital-popup-row {
  display: flex;
  gap: 6px;
  margin-bottom: 3px;
  word-break: break-word;
}

.hospital-popup-label {
  flex-shrink: 0;
  color: #555;
  font-size: 11px;
  min-width: 70px;
}

.hospital-popup-value {
  color: #222;
  font-size: 12px;
  word-break: break-word;
}

.hospital-popup-link {
  font-size: 12px;
  color: #1a73e8;
  word-break: break-all;
  text-decoration: none;
}

.hospital-popup-link:hover {
  text-decoration: underline;
}

.hospital-popup-loading {
  text-align: center;
  color: #888;
  font-size: 12px;
  padding: 4px 0;
}