@charset "UTF-8";

/*
 * 地図ボタンの大きさ・形・アイコン（デザインFB 2026-10-24「地図ボタン（指示12）」）
 *
 * 対象：昼／夜・リップル・平面／俯瞰・ズーム（＋−）・検索（PC の地図右上のみ）・センタリング・現在地。
 * GoogleMaps／テーマファイルの両モード、管理ページと View mode の両方に当てる。
 *
 *   大きさ … PC・SP とも ボタン 40px／アイコン 20px（SVG は 22px の枠。20px に縮めて使う）
 *   形     … 白い丸。ズームだけ ＋ と − を縦のカプセルにまとめ、間に 1px の線
 *   影     … 0 2px 8px rgba(0,0,0,.18)
 *   間隔   … ボタンどうし 10px／画面の左右の端から 14px
 *   下端   … GoogleMaps は Google のロゴと帰属表示を避けて地図の下端から 26px
 *   アイコン … 線 1.8px・#111（色は SVG に焼き込み済み。状態で色は変えない）
 *
 * ★既存の意匠の上から当てる★
 * ボタンはそれぞれ別のファイルで作られ（map-tilt.css／map-side-control.css／gmaps.css／
 * jquery.mapping.css）、置き場所も PC と SP で違う（SP は地図外の操作行へ複製している）。
 * それらを書き換えて回る代わりに、このファイルを最後に読み込み、大きさ・形・余白だけを上書きする。
 * 詳細度の勝負になる箇所は !important で確実に勝たせる（既存側も !important を多用しているため）。
 *
 * アイコンは <i class="map-btn-icon map-btn-icon--{名前}"> に背景画像として描く。
 * マスク（mask-image）にしないのは、リップルの SVG が白の塗りで重なりを抜いているため
 * （マスクだと白も不透明として塗られて形が崩れる）。
 */

:root {
  --map-btn-size: 40px;
  --map-btn-icon-size: 20px;
  --map-btn-gap: 10px;
  --map-btn-edge: 14px;
  --map-btn-bottom-gmap: 26px;
  --map-btn-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  --map-btn-divider: 1px solid rgba(0, 0, 0, 0.1);
  /* ＋は少し下、−は少し上へ寄せて、区切り線をはさんだ上下のつり合いをとる（4px は寄りすぎ、0 は離れすぎ） */
  --map-btn-zoom-nudge: 2px;
}

/* --------------------------------------------------------------------------
 * アイコン
 * -------------------------------------------------------------------------- */

.map-btn-icon {
  display: block;
  width: var(--map-btn-icon-size);
  height: var(--map-btn-icon-size);
  background: no-repeat center / contain;
  /* Font Awesome の <i> と同じ要素を使うので、字形の名残を消す */
  font-size: 0 !important;
  line-height: 0 !important;
  flex: 0 0 auto;
  /* 現在地ボタンの「鏃の字面を寄せる」補正（gmaps.css）を打ち消す */
  position: static !important;
}

.map-btn-icon::before {
  content: none !important;
}

.map-btn-icon--day { background-image: url("../img/map-buttons/day.svg"); }
.map-btn-icon--night { background-image: url("../img/map-buttons/night.svg"); }
.map-btn-icon--ripple { background-image: url("../img/map-buttons/ripple.svg"); }
.map-btn-icon--flat { background-image: url("../img/map-buttons/flat.svg"); }
.map-btn-icon--tilt { background-image: url("../img/map-buttons/tilt.svg"); }
.map-btn-icon--search { background-image: url("../img/map-buttons/search.svg"); }
.map-btn-icon--center { background-image: url("../img/map-buttons/center.svg"); }
.map-btn-icon--locate { background-image: url("../img/map-buttons/locate.svg"); }

/* --------------------------------------------------------------------------
 * 左下の列：ズーム・平面／俯瞰・リップル・昼夜
 *   PC  … 地図内の Leaflet 左下コーナー
 *   SP  … 操作行（.sp-leaflet-control-zoom-wrapper）へ複製したもの。拡大表示中だけ地図内
 * どちらの置き場所でも同じ形にする（ユーザー指示 2026-10-24：PC と SP で DOM が違っても揃える）。
 * -------------------------------------------------------------------------- */

:is(.leaflet-control-container, .sp-leaflet-control-zoom-wrapper)
  :is(.leaflet-control-zoom, .map-tilt-control, .map-side-control) {
  border: none !important;
  border-radius: calc(var(--map-btn-size) / 2) !important;
  background: #fff !important;
  background-clip: border-box !important;
  box-shadow: var(--map-btn-shadow) !important;
  /* overflow:hidden で角を切ってはいけない。SP の操作行へ複製したズームと平面／俯瞰は箱の高さが 0 で、
     ボタンは箱の外へはみ出して描かれている（一緒に消える）。角丸はボタン（a）側に付ける */
}

:is(.leaflet-control-container, .sp-leaflet-control-zoom-wrapper)
  :is(.leaflet-control-zoom, .map-tilt-control, .map-side-control)
  a,
:is(.leaflet-control-container, .sp-leaflet-control-zoom-wrapper)
  :is(.leaflet-control-zoom, .map-tilt-control, .map-side-control)
  a:is(:hover, :focus, :active) {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: var(--map-btn-size) !important;
  height: var(--map-btn-size) !important;
  line-height: var(--map-btn-size) !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 50% !important;
  background: #fff !important;
  color: #111;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* ズームのカプセル：上のボタンは上側だけ、下のボタンは下側だけ丸める */
:is(.leaflet-control-container, .sp-leaflet-control-zoom-wrapper)
  .leaflet-control-zoom
  .leaflet-control-zoom-in {
  border-radius: calc(var(--map-btn-size) / 2) calc(var(--map-btn-size) / 2) 0 0 !important;
}

:is(.leaflet-control-container, .sp-leaflet-control-zoom-wrapper)
  .leaflet-control-zoom
  .leaflet-control-zoom-out {
  border-radius: 0 0 calc(var(--map-btn-size) / 2) calc(var(--map-btn-size) / 2) !important;
}

/* ズーム：＋と−の間に細い線。文字の＋−は消し、SVG を疑似要素で描く */
:is(.leaflet-control-container, .sp-leaflet-control-zoom-wrapper)
  .leaflet-control-zoom
  .leaflet-control-zoom-in {
  border-bottom: var(--map-btn-divider) !important;
}

:is(.leaflet-control-container, .sp-leaflet-control-zoom-wrapper)
  .leaflet-control-zoom
  :is(.leaflet-control-zoom-in, .leaflet-control-zoom-out) {
  font-size: 0 !important;
  color: transparent !important;
}

:is(.leaflet-control-container, .sp-leaflet-control-zoom-wrapper)
  .leaflet-control-zoom
  :is(.leaflet-control-zoom-in, .leaflet-control-zoom-out)::after {
  content: "";
  display: block;
  width: var(--map-btn-icon-size);
  height: var(--map-btn-icon-size);
  background: no-repeat center / contain;
}

:is(.leaflet-control-container, .sp-leaflet-control-zoom-wrapper)
  .leaflet-control-zoom
  .leaflet-control-zoom-in::after {
  background-image: url("../img/map-buttons/zoom-in.svg");
  transform: translateY(var(--map-btn-zoom-nudge));
}

:is(.leaflet-control-container, .sp-leaflet-control-zoom-wrapper)
  .leaflet-control-zoom
  .leaflet-control-zoom-out::after {
  background-image: url("../img/map-buttons/zoom-out.svg");
  transform: translateY(calc(var(--map-btn-zoom-nudge) * -1));
}

/* 押せないとき（最大・最小ズーム／編集中の平面／俯瞰）は薄くする。Leaflet 既定の灰色の背景は使わない */
:is(.leaflet-control-container, .sp-leaflet-control-zoom-wrapper)
  .leaflet-control-zoom
  a.leaflet-disabled::after {
  opacity: 0.35;
}

/* PC：地図内の左下コーナー。下から ズーム → 平面／俯瞰 → リップル → 昼夜。
   コーナーの DOM は上から [昼夜, リップル, 平面／俯瞰, ズーム]（map-side-control.js の order）。
   ボタンどうしの間隔は「上に積むボタンの下マージン」で取る */
.leaflet-container:not(.gmap-picker-map)
  .leaflet-bottom.leaflet-left
  > :is(.leaflet-control-zoom, .map-tilt-control, .map-side-control) {
  margin: 0 0 var(--map-btn-gap) var(--map-btn-edge) !important;
}

/* map-side-control.css がズームの上に足している 8px（以前の間隔合わせ）を打ち消す。
   間隔は上に積むボタンの下マージン（10px）だけで取る。詳細度を向こう（:not が 2 つ＋隣接）に合わせて勝たせる */
.leaflet-container:not(.is-side-controls-row):not(.gmap-picker-map)
  .leaflet-bottom.leaflet-left
  > :is(.map-tilt-control, .map-side-control)
  + .leaflet-control-zoom {
  margin-top: 0 !important;
}

/* 列の一番下（ズーム）だけ、地図の下端からの距離を取る。
   テーマファイルは Google の帰属表示が無いので、左右の端と同じ 14px にそろえる（2026-10-24 時点の暫定。見た目で相談） */
.leaflet-container:not(.gmap-picker-map) .leaflet-bottom.leaflet-left > .leaflet-control-zoom {
  margin-bottom: var(--map-btn-edge) !important;
}

.leaflet-container.gmap-mode:not(.gmap-picker-map) .leaflet-bottom.leaflet-left > .leaflet-control-zoom {
  margin-bottom: var(--map-btn-bottom-gmap) !important;
}

/* 地図の背が低いときの横一列（map-side-control.css の .is-side-controls-row）も同じ間隔にする。
   DOM 順を row-reverse で並べているので、ズームの右隣から順に間隔を取る */
@media (min-width: 992px) {
  .leaflet-container.is-side-controls-row:not(.gmap-picker-map)
    .leaflet-bottom.leaflet-left
    > :is(.map-tilt-control, .map-side-control) {
    margin: 0 0 var(--map-btn-edge) var(--map-btn-gap) !important;
  }

  .leaflet-container.gmap-mode.is-side-controls-row:not(.gmap-picker-map)
    .leaflet-bottom.leaflet-left
    > :is(.map-tilt-control, .map-side-control) {
    margin-bottom: var(--map-btn-bottom-gmap) !important;
  }
}

/* --------------------------------------------------------------------------
 * SP：操作行（地図の下、シートの上端）の左の列
 * -------------------------------------------------------------------------- */

@media (max-width: 991px) {
  /* 操作行（.topic-list-content-header の px-3＝左右 1rem の内側）の左端の列。
     画面の左端から 14px に置くため、行の内側の余白（1rem）との差だけ左へ出す。
     右の余白は「場所取りの幅」の調整（map-tilt.css）：行の中央の開くボタンを厳密な中央に置くため、
     この列の幅（左右の余白込み）を右端の閉じるボタンの枠（50px）と同じに見せる */
  .sp-leaflet-control-zoom-wrapper {
    --sp-map-controls-shift: calc(var(--map-btn-edge) - 1rem);
    gap: var(--map-btn-gap) !important;
    margin-left: var(--sp-map-controls-shift) !important;
    margin-right: calc(50px - var(--map-btn-size) - var(--sp-map-controls-shift)) !important;
  }

  .sp-leaflet-control-zoom-wrapper .map-side-control-sp-stack {
    gap: var(--map-btn-gap) !important;
  }

  /* 上へはみ出す分（map-side-control.css）：平面／俯瞰と切り替えボタン 2 つ＋その間隔 3 つに、
     ズームが以前（30px×2）より背が高くなった分の 10px と、影（8px のぼかし＋2px のずれ）の 10px を足す。
     足りないと一番上のボタン（昼夜）の上端と影がシートの上端で切れる（390×844 の実測で確認） */
  :root {
    --sp-map-controls-overflow: calc(var(--map-btn-size) * 3 + var(--map-btn-gap) * 3 + 20px);
  }

  /* 拡大表示中（地図内に戻したとき）も PC と同じ間隔 */
  body.is-view-expand
    .leaflet-control-container
    .leaflet-bottom.leaflet-left
    > :is(.leaflet-control-zoom, .map-tilt-control, .map-side-control) {
    margin: 0 0 var(--map-btn-gap) var(--map-btn-edge) !important;
  }

  body.is-view-expand .leaflet-control-container .leaflet-bottom.leaflet-left > .leaflet-control-zoom {
    margin-bottom: var(--map-btn-edge) !important;
  }

  body.is-view-expand:has(.leaflet-container.gmap-mode)
    .leaflet-control-container
    .leaflet-bottom.leaflet-left
    > .leaflet-control-zoom {
    margin-bottom: var(--map-btn-bottom-gmap) !important;
  }
}

/* --------------------------------------------------------------------------
 * 右下：センタリング・現在地（GoogleMaps）
 *   PC … 地図右下の積み上げ（gmaps.css の li.gmap-map-pc-controls-stack）
 *   SP … シートの閉じるボタンの場所（.gmap-viewmode-controls-sp-overlay）
 * -------------------------------------------------------------------------- */

.gmap-viewmode-controls {
  gap: var(--map-btn-gap) !important;
}

:is([data-pc-placement-of="gmap-viewmode-controls"], .gmap-viewmode-controls-sp-overlay) .gmap-toggle-btn,
:is([data-pc-placement-of="gmap-viewmode-controls"], .gmap-viewmode-controls-sp-overlay)
  .gmap-toggle-btn:is(:hover, :focus, :focus-visible, :active) {
  width: var(--map-btn-size) !important;
  height: var(--map-btn-size) !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 50% !important;
  background-color: #fff !important;
  box-shadow: var(--map-btn-shadow) !important;
  opacity: 1 !important;
}

@media (min-width: 992px) {
  /* 積み上げ行の高さ（ルート情報モジュールも同じ高さにそろう） */
  li.gmap-map-pc-controls-stack {
    --gmap-pc-control-h: var(--map-btn-size);
  }

  /* 右・下の余白。拡大表示中は終了ボタンの真上へ積む別の指定（gmaps.css）があるので通常表示だけ */
  body:not(.is-view-expand) li.gmap-map-pc-controls-stack {
    right: var(--map-btn-edge) !important;
    bottom: var(--map-btn-bottom-gmap) !important;
  }

  body:has(.map-reset-view-gmap-btn) {
    --gmap-reset-view-stack-extra: calc(var(--map-btn-size) + var(--map-btn-gap));
  }

  /* ルート距離／所要時間（現在地ボタンの左隣）。高さはボタンの径ちょうど、影もボタンにそろえる。
     gmaps.css は min-height だけなので、中身（31px）＋上下 6px の余白で 43px に伸びていた（ユーザー指摘）。
     上下の余白を無くして高さを固定し、中身は上下中央（align-items:center）に置く */
  li.gmap-map-pc-controls-stack .gmap-route-info {
    height: var(--map-btn-size);
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-shadow: var(--map-btn-shadow) !important;
  }
}

@media (max-width: 991px) {
  body:has(.map-reset-view-gmap-btn) {
    --gmap-reset-view-stack-extra: calc(var(--map-btn-size) + var(--map-btn-gap));
  }
}

/* --------------------------------------------------------------------------
 * 右下：センタリング（テーマファイル。map-reset-view.js の L.Control）
 * -------------------------------------------------------------------------- */

.leaflet-container:not(.gmap-picker-map) .leaflet-bottom.leaflet-right > .map-reset-view-control {
  margin: 0 var(--map-btn-edge) var(--map-btn-edge) 0 !important;
}

.map-reset-view-control {
  border: none !important;
  border-radius: 50% !important;
  background: #fff !important;
  box-shadow: var(--map-btn-shadow) !important;
}

.map-reset-view-control a {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: var(--map-btn-size) !important;
  height: var(--map-btn-size) !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 50% !important;
  background: #fff !important;
}

/* --------------------------------------------------------------------------
 * 右上：検索（PC の地図右上のみ。格納時の正円＝ボタン 40px）
 * -------------------------------------------------------------------------- */

@media (min-width: 992px) {
  [data-pc-placement-of="search-module-wrapper"] .search-module-wrapper {
    --topics-search-box-h: var(--map-btn-size) !important;
  }

  [data-pc-placement-of="search-module-wrapper"] .search-module-wrapper .input-group-with-buttons {
    box-shadow: var(--map-btn-shadow) !important;
  }
}

/* --------------------------------------------------------------------------
 * 拡大表示の終了ボタン（ユーザー指示 2026-10-24：ほかの地図ボタンと同じ大きさに）
 *   PC … 固定フッタ（.card-footer）の右端。位置はフッタの余白で決まる
 *   SP … position:fixed のフローティングボタン（.btn-view-compress-for-sp）
 * 右下の列の一番下に置き、左下のズームと同じく 右から 14px・下から 26px（テーマは 14px）。
 * 先方のアイコン一式に終了ボタンは無いので、絵柄は既存の icon-svg-frame-compress を 20px で使う。
 * -------------------------------------------------------------------------- */

.btn-circle-with-icon.btn-view-expand-or-compress.btn-view-compress,
.btn-circle-with-icon.btn-view-expand-or-compress.btn-view-compress:is(:hover, :focus, :active) {
  width: var(--map-btn-size) !important;
  height: var(--map-btn-size) !important;
  border: none !important;
  background-color: #fff !important;
  box-shadow: var(--map-btn-shadow) !important;
  opacity: 1 !important;
  color: #111;
  font-size: var(--map-btn-icon-size) !important;
}

@media (min-width: 992px) {
  body.is-view-expand .project-main-content .card-project-main-content .card-footer {
    padding-right: var(--map-btn-edge) !important;
    padding-bottom: var(--map-btn-edge) !important;
  }

  /* フッタの行は（見えなくしてある）タイトル欄の高さ 54px で上下中央にそろうので、終了ボタンが 3px 浮く。
     ボタンの器の上余白（mt-2）を消して、行の下端へ付ける */
  body.is-view-expand .card-footer .btn-view-expand-or-compress-wrapper {
    margin-top: 0 !important;
  }

  body.is-view-expand .card-footer :has(> .btn-view-expand-or-compress-wrapper) {
    align-self: flex-end;
  }

  body.is-view-expand:has(.leaflet-container.gmap-mode)
    .project-main-content
    .card-project-main-content
    .card-footer {
    padding-bottom: var(--map-btn-bottom-gmap) !important;
  }
}

@media (max-width: 991px) {
  .project-main-content .btn-view-expand-or-compress.btn-view-compress.btn-view-compress-for-sp {
    right: var(--map-btn-edge) !important;
    bottom: var(--map-btn-edge) !important;
  }

  body.is-view-expand:has(.leaflet-container.gmap-mode)
    .project-main-content
    .btn-view-expand-or-compress.btn-view-compress.btn-view-compress-for-sp {
    bottom: var(--map-btn-bottom-gmap) !important;
  }
}

/* 拡大表示中、終了ボタンの上へ 10px 間隔で積むもの：
   GoogleMaps … 現在地・センタリングの積み上げ（li.gmap-map-pc-controls-stack。SP もこの器へ移される）
   テーマ     … センタリング（.map-reset-view-control） */
/* SP では器（.gmap-viewmode-controls.my-2）の上下 8px が残るので消す（PC は gmaps.css で消してある） */
body.is-view-expand:has(.leaflet-container.gmap-mode) li.gmap-map-pc-controls-stack .gmap-viewmode-controls {
  margin: 0 !important;
}

body.is-view-expand:has(.leaflet-container.gmap-mode) li.gmap-map-pc-controls-stack {
  --gmap-pc-control-h: var(--map-btn-size) !important;
  right: var(--map-btn-edge) !important;
  bottom: calc(var(--map-btn-bottom-gmap) + var(--map-btn-size) + var(--map-btn-gap)) !important;
  gap: var(--map-btn-gap) !important;
}

@media (min-width: 992px) {
  /* ルート情報は終了ボタンの左隣（同じ行）へ。間隔はボタンどうしと同じ 10px */
  body.is-view-expand:has(.leaflet-container.gmap-mode) li.gmap-map-pc-controls-stack .gmap-route-info {
    top: calc(100% + var(--map-btn-gap)) !important;
    right: calc(var(--map-btn-size) + var(--map-btn-gap)) !important;
  }
}

body.is-view-expand .leaflet-container:not(.gmap-mode) .leaflet-bottom.leaflet-right > .map-reset-view-control {
  margin-right: var(--map-btn-edge) !important;
  margin-bottom: calc(var(--map-btn-edge) + var(--map-btn-size) + var(--map-btn-gap)) !important;
}

/* --------------------------------------------------------------------------
 * ピン表示のチェックボックスリスト（PC の地図右側。ユーザー指示 2026-10-24）
 * 幅・影・間隔を地図ボタンにそろえ、ズームと同じカプセル形にする。
 * 右下のボタンの列（センタリング／現在地、拡大表示中はその下に終了ボタン）の上へ 10px 間隔で積む。
 * 位置の式は jquery.mapping.css の共通ブロックが --pin-list-bottom / --pin-list-right を読むので、ここでは変数だけ差し替える。
 * -------------------------------------------------------------------------- */

@media (min-width: 992px) {
  .leaflet-container:not(.gmap-picker-map)
    .leaflet-control-container
    .leaflet-custom-layer-control
    .leaflet-control-layers-expanded {
    --pin-list-gap: var(--map-btn-gap);
    --pin-list-right: var(--map-btn-edge);
    width: var(--map-btn-size) !important;
    /* 上下のゆとり（ユーザー指摘：詰まって見える）。この箱自体がスクロール領域なので、padding はスクロールと
       一緒に流れてしまう。流れない余白は白い border で取り、padding は中身との最小限の間だけにする */
    padding: 6px 0 !important;
    border-top: 10px solid #fff !important;
    border-bottom: 10px solid #fff !important;
    border-radius: calc(var(--map-btn-size) / 2) !important;
    box-shadow: var(--map-btn-shadow) !important;
  }

  /* テーマ：センタリング 1 つの上 */
  .leaflet-container:not(.gmap-mode):not(.gmap-picker-map)
    .leaflet-custom-layer-control
    .leaflet-control-layers-expanded {
    --pin-list-bottom: calc(var(--map-btn-edge) + var(--map-btn-size) + var(--pin-list-gap)) !important;
  }

  /* GoogleMaps：現在地とセンタリング（--gmap-reset-view-stack-extra）の上 */
  .leaflet-container.gmap-mode:not(.gmap-picker-map)
    .leaflet-custom-layer-control
    .leaflet-control-layers-expanded {
    --pin-list-bottom: calc(
      var(--map-btn-bottom-gmap) + var(--map-btn-size) + var(--gmap-reset-view-stack-extra, 0px) + var(--pin-list-gap)
    ) !important;
  }

  /* 拡大表示中は、さらにその下に終了ボタン 1 つ分（＋間隔）が入る */
  body.is-view-expand
    .leaflet-container:not(.gmap-mode)
    .leaflet-custom-layer-control
    .leaflet-control-layers-expanded {
    --pin-list-right: var(--map-btn-edge) !important;
    --pin-list-bottom: calc(
      var(--map-btn-edge) + (var(--map-btn-size) + var(--map-btn-gap)) * 2
    ) !important;
  }

  body.is-view-expand
    .leaflet-container.gmap-mode
    .leaflet-control-container
    .leaflet-custom-layer-control
    .leaflet-control-layers-expanded {
    --pin-list-right: var(--map-btn-edge) !important;
    --pin-list-bottom: calc(
      var(--map-btn-bottom-gmap) + (var(--map-btn-size) + var(--map-btn-gap)) * 2 +
        var(--gmap-reset-view-stack-extra, 0px)
    ) !important;
  }
}

/* --------------------------------------------------------------------------
 * ツアーのコントローラ（PC の地図下部中央。ユーザー指示 2026-10-24）
 * 影・下端・高さを地図ボタンにそろえる（高さ 60px → 40px）。SP は画面上部の吹き出し（.is-sp）なので対象外。
 * 中の再生ボタンは高さいっぱいの丸（36px）、文字 2 行は行送りを詰めて収める。
 * -------------------------------------------------------------------------- */

.map-tour-controller:not(.is-sp) {
  bottom: var(--map-btn-edge);
  height: var(--map-btn-size);
  padding: 2px 10px 2px 2px;
  box-shadow: var(--map-btn-shadow);
  /* 左右のボタンの列（端から 14px＋40px）に重ならない幅 */
  width: min(540px, calc(100% - (var(--map-btn-edge) + var(--map-btn-size) + var(--map-btn-gap)) * 2));
}

/* PC のコントローラは地図コンテナの中へ置かれる（map-tour.js の placeController） */
.leaflet-container.gmap-mode .map-tour-controller:not(.is-sp) {
  bottom: var(--map-btn-bottom-gmap);
}

.map-tour-controller:not(.is-sp) .map-tour-text {
  gap: 0;
}

.map-tour-controller:not(.is-sp) :is(.map-tour-title, .map-tour-step) {
  line-height: 1.25;
}

/* --------------------------------------------------------------------------
 * SP：左右の列の位置合わせと、狭い画面での余白（ユーザー指示 2026-10-24）
 *
 * ① 画面の端からの余白・ボタンどうしの間隔は、画面幅に合わせてなめらかに縮める。
 *    390px 幅で資料どおりの 14px／10px、320px 幅で約 11px／8px（最小 8px／6px）。
 *    一覧を開いたときの横一列は、資料の値のままだと約 318px 未満の幅で左右がぶつかるため。
 * ② 右の列（センタリング・現在地）を左の列と同じ「端からの余白」と「底」にそろえる。
 *    右の列は閉じるボタンの枠（行の内側 1rem）を基準に置かれていて、左の列とは基準が違う。
 *    底の差は実測（GoogleMaps 13.5px／テーマ 6.5px。一覧の開閉・画面幅によらず一定）を足して埋める。
 *    GoogleMaps の底は Google のロゴの上（左のズームと同じ高さ）になる。
 * -------------------------------------------------------------------------- */

@media (max-width: 991px) {
  :root {
    --map-btn-edge: clamp(8px, 3.6vw, 14px);
    --map-btn-gap: clamp(6px, 2.6vw, 10px);
  }

  .gmap-viewmode-controls-sp-overlay {
    right: calc(var(--map-btn-edge) - 1rem) !important;
    /* gmaps.css の 15px（帰属表示を避ける持ち上げ）に、左のズームとの差 13.5px を足す */
    margin-bottom: calc(15px + 13.5px) !important;
  }

  .map-reset-view-sp-overlay {
    right: calc(var(--map-btn-edge) - 1rem) !important;
    /* jquery.mapping.css の 0.875rem（閉じるボタンの枠の底上げ）に、左のズームとの差 6.5px を足す */
    bottom: calc(0.875rem + 6.5px) !important;
  }
}
