/* ============================================================
   デザイントークン
   ============================================================ */
:root {
  --color-primary:   #285C45;
  --color-primary-2: #3F765B;
  --color-bg:        #F7F4EC;
  --color-surface:   #FFFFFF;
  --color-text:      #1F2924;
  --color-muted:     #66736C;
  --color-border:    #D9E2DC;
  --color-danger:    #C0392B;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-card:  0 8px 24px rgba(31,41,36,.10);
  --shadow-sheet: 0 -4px 32px rgba(31,41,36,.12);
  --shadow-modal: 0 8px 48px rgba(31,41,36,.20);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  --header-h: 56px;
  --filter-h: 44px;
}

/* ============================================================
   ベースリセット
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* hidden 属性を CSS の display: flex/block が上書きしないようにする */
[hidden] { display: none !important; }

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  overflow: hidden;
  height: 100dvh;
}

img { display: block; max-width: 100%; }

a { color: inherit; }

button, select, input {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; border: none; background: none; }

select {
  cursor: pointer;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  padding: 4px 8px;
}

/* ============================================================
   アクセシビリティ
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: var(--space-4);
  z-index: 9999;
  background: var(--color-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  transition: top 0.2s;
}
.skip-link:focus { top: var(--space-2); }

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.noscript-msg {
  padding: var(--space-4);
  background: #fff3cd;
  text-align: center;
}

/* ============================================================
   ヘッダー
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.app-logo-img {
  height: 36px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.header-search {
  flex: 1;
  min-width: 0;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--color-muted);
  pointer-events: none;
}

#search-input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 40px;
  border: 1.5px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-bg);
  font-size: 14px;
  transition: border-color 0.15s;
}
#search-input:focus { border-color: var(--color-primary); outline: none; }
#search-input::placeholder { color: var(--color-muted); }

.search-clear {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  color: var(--color-muted);
}
.search-clear:hover { background: var(--color-border); }

.header-actions { display: flex; gap: var(--space-2); flex-shrink: 0; }

.icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  color: var(--color-text);
}
.icon-btn:hover { background: var(--color-bg); }

.fav-badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 18px; height: 18px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* 初回保存ヒント（吹き出しUI） */
.fav-hint-wrap { position: relative; }

.fav-hint {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: var(--color-text);
  color: #fff;
  font-size: 13px;
  line-height: 1.55;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-modal);
  z-index: 200;
  animation: fav-hint-in 0.2s ease;
}

.fav-hint::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 12px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--color-text);
}

.fav-hint p { padding-right: var(--space-4); }

.fav-hint-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: rgba(255,255,255,.65);
  font-size: 12px;
}
.fav-hint-close:hover { color: #fff; background: rgba(255,255,255,.15); }

@keyframes fav-hint-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   クイック条件チップ
   ============================================================ */
.quick-filters {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  height: var(--filter-h);
  display: flex;
  align-items: center;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

/* スクロール可能エリア（チップ群） */
.filter-scroll-area {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 var(--space-3) 0 var(--space-4);
  height: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }

/* 右端グラデーションフェード */
.filter-scroll-fade {
  position: absolute;
  top: 0; right: 0;
  width: 32px;
  height: 100%;
  background: linear-gradient(to right, transparent, var(--color-surface));
  pointer-events: none;
}

.chip {
  flex-shrink: 0;
  height: 30px;
  padding: 0 13px;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
}
.chip:hover:not(.active):not([aria-pressed="true"]) {
  border-color: var(--color-primary-2);
  color: var(--color-primary);
}
.chip[aria-pressed="true"],
.chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(40,92,69,.25);
}

/* ピン留め絞り込みボタン */
.filter-action-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 var(--space-3) 0 0;
  border-left: 1px solid var(--color-border);
  margin-left: var(--space-2);
}

.btn-filter-open {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  min-height: 44px;
  margin-left: var(--space-2);
  position: relative;
}
.btn-filter-open:hover {
  border-color: var(--color-primary-2);
  color: var(--color-primary);
}
.btn-filter-open.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(40,92,69,.25);
}

.filter-active-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #fff;
  color: var(--color-primary);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

/* ============================================================
   メインレイアウト（モバイル）
   ============================================================ */
.explorer-layout {
  position: relative;
  height: calc(100dvh - var(--header-h) - var(--filter-h));
  overflow: hidden;
}

/* 地図パネル */
.map-panel {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Leaflet コンテナ */
#leaflet-map {
  width: 100%;
  height: 100%;
  background: #e8f0ea; /* タイル読み込み前の背景 */
}

/* カスタムマーカー */
.leaflet-custom-marker {
  background: none;
  border: none;
}
.leaflet-custom-marker svg {
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}

/* スポット情報カード（地図の下端に浮かぶ） */
.map-spot-card {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  padding: var(--space-3) var(--space-4);
  min-width: 200px;
  max-width: calc(100% - 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}

.map-spot-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}
.map-spot-address {
  font-size: 12px;
  color: var(--color-muted);
}
.map-spot-note {
  font-size: 11px;
  color: var(--color-muted);
  font-style: italic;
}
.map-spot-note--warn {
  color: #c0392b;
  font-style: normal;
  font-weight: 600;
}

.btn-gmaps-preview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-1);
  padding: 9px 18px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-gmaps-preview:hover { background: var(--color-primary-2); }

/* ジオコーディング中インジケーター */
.map-loading {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--color-surface);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--color-muted);
  box-shadow: var(--shadow-card);
  white-space: nowrap;
}

/* ============================================================
   ルート検索 UI
   ============================================================ */
.route-divider {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  margin: var(--space-2) 0;
}

.route-from-row {
  display: flex;
  gap: var(--space-2);
  width: 100%;
  align-items: center;
}

.route-from-row select {
  flex: 1;
  font-size: 12px;
  height: 36px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
  min-width: 0;
}

.btn-show-route {
  flex-shrink: 0;
  height: 36px;
  padding: 0 12px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.btn-show-route:hover { background: var(--color-primary-2); }
.btn-show-route:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.route-summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  width: 100%;
  justify-content: center;
  padding-top: var(--space-1);
}

.route-dot { color: var(--color-muted); }

.btn-clear-route {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  color: var(--color-muted);
  flex-shrink: 0;
}
.btn-clear-route:hover { background: var(--color-bg); }

.route-error {
  font-size: 12px;
  color: var(--color-danger);
  text-align: center;
}

/* LRM デフォルトパネルを非表示（ルート線だけを使う） */
.leaflet-routing-container { display: none !important; }

/* 出発地マーカー */
.route-start-marker {
  background: none;
  border: none;
}

/* 候補パネル（ボトムシート） */
.results-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: calc(100dvh - var(--header-h) - var(--filter-h));
  transform: translateY(calc(100dvh - var(--header-h) - var(--filter-h) - 38vh));
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  background: var(--color-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-sheet);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

.results-panel.expanded {
  transform: translateY(0);
}

/* シートハンドル */
.sheet-handle-area {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 28px;
  cursor: pointer;
}
.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--color-border);
}
.sheet-handle-area:hover .sheet-handle { background: var(--color-muted); }

/* ============================================================
   リスト表示
   ============================================================ */
.list-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.results-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  gap: var(--space-2);
}

#results-count {
  font-size: 13px;
  color: var(--color-muted);
  font-weight: 500;
}

#sort-select {
  font-size: 13px;
  padding: 4px 8px;
}

/* ============================================================
   カードカルーセル（モバイル）
   ============================================================ */
.card-carousel {
  flex: 1;
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4) var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.card-carousel::-webkit-scrollbar { display: none; }

/* カルーセルナビ */
.carousel-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-2) 0 var(--space-3);
}

.carousel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1.5px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-text);
}
.carousel-btn:hover { background: var(--color-bg); }

#carousel-pos {
  font-size: 13px;
  color: var(--color-muted);
  min-width: 60px;
  text-align: center;
}

/* ============================================================
   スポットカード
   ============================================================ */
.spot-card {
  scroll-snap-align: center;
  flex: 0 0 calc(100% - 32px);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-3);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 0;
}
.spot-card:hover { border-color: var(--color-border); }
.spot-card.selected { border-color: var(--color-primary); }

.card-img-wrap {
  flex-shrink: 0;
  width: 120px;
  height: 90px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-bg);
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-border);
  background: var(--color-bg);
}

.card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.card-group {
  font-size: 11px;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-desc {
  font-size: 13px;
  color: var(--color-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.card-meta {
  font-size: 11px;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.btn-card-maps {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  min-height: 32px;
}
.btn-card-maps:hover { background: var(--color-primary-2); }

.btn-card-detail {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  min-height: 32px;
}
.btn-card-detail:hover { background: var(--color-bg); }

.btn-card-fav {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  color: var(--color-muted);
  flex-shrink: 0;
}
.btn-card-fav:hover { background: var(--color-bg); }
.btn-card-fav[aria-pressed="true"] { color: var(--color-primary); }

/* スケルトンカード */
.card-skeleton {
  flex: 0 0 calc(100% - 32px);
  scroll-snap-align: center;
  display: flex;
  gap: var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}
.skel-img {
  flex-shrink: 0;
  width: 120px; height: 90px;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  animation: skel-pulse 1.5s ease-in-out infinite;
}
.skel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-2);
}
.skel-line {
  height: 12px;
  border-radius: 6px;
  background: var(--color-bg);
  animation: skel-pulse 1.5s ease-in-out infinite;
}
.skel-line-lg { width: 80%; height: 15px; }
.skel-line-sm { width: 50%; }

@keyframes skel-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   空結果・エラー
   ============================================================ */
.empty-state,
.error-state {
  padding: var(--space-8) var(--space-6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.empty-title,
.error-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.empty-sub {
  font-size: 13px;
  color: var(--color-muted);
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-2);
}

.btn-reset-condition {
  padding: 8px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  font-size: 13px;
  background: var(--color-surface);
}
.btn-reset-condition:hover { background: var(--color-bg); }

.btn-retry {
  padding: 10px 20px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.btn-retry:hover { background: var(--color-primary-2); }

/* PC詳細パネル（モバイルは非表示） */
.pc-detail-panel { display: none; }

/* ============================================================
   詳細ダイアログ（モバイル / ボトムシート）
   ============================================================ */
.detail-dialog:not([hidden]) {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 200;
  flex-direction: column;
  background: var(--color-surface);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.detail-dialog.open { transform: translateY(8%); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

.detail-dialog-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.detail-handle-area {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: var(--space-2) 0;
}

.detail-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--color-muted);
  z-index: 1;
}
.detail-close:hover { background: var(--color-bg); }

/* ============================================================
   詳細コンテンツ（モバイル詳細ダイアログ & PC左パネル共通）
   ============================================================ */
.detail-content {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-bg);
  overflow: hidden;
}

.detail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-body {
  padding: var(--space-4) var(--space-4) var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.detail-group {
  font-size: 12px;
  color: var(--color-muted);
  font-weight: 500;
}

.detail-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
}

.detail-desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-text);
}

/* Primary CTA */
.btn-gmaps-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.btn-gmaps-main:hover { background: var(--color-primary-2); }

/* Secondary: 保存 */
.btn-save {
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  background: var(--color-surface);
  transition: background 0.15s, border-color 0.15s;
}
.btn-save[aria-pressed="true"] {
  background: var(--color-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn-save:hover { background: var(--color-bg); }

/* 詳細情報行 */
.detail-info-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.detail-info-row {
  display: flex;
  gap: var(--space-3);
  font-size: 13px;
}

.info-label {
  flex-shrink: 0;
  width: 72px;
  color: var(--color-muted);
  font-weight: 500;
}

.info-value { flex: 1; word-break: break-all; }

.info-hours-note {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: var(--space-1);
  font-style: italic;
}

/* 特徴チップ */
.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.feature-chip {
  padding: 4px 10px;
  background: var(--color-bg);
  border-radius: 999px;
  font-size: 12px;
  color: var(--color-text);
}

/* 詳細説明 */
.detail-summary {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-muted);
}

/* Tertiary links */
.detail-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.detail-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-primary);
  text-decoration: underline;
  word-break: break-all;
}

/* 情報フッター */
.detail-footer {
  font-size: 12px;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-3);
}

/* ============================================================
   モーダルダイアログ（絞り込み・保存済み）
   ============================================================ */
.modal-dialog {
  position: fixed;
  inset: 0;
  z-index: 300;
  /* display は [hidden] ルールと競合しないよう :not([hidden]) で指定 */
  align-items: flex-end;
  /* 半透明背景をオーバーレイ自身に持たせ、外クリックで閉じられるようにする */
  background: rgba(31,41,36,.35);
}
.modal-dialog:not([hidden]) { display: flex; }

.modal-inner {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  background: var(--color-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  max-height: 85dvh;
  padding-bottom: env(safe-area-inset-bottom);
}

.modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.modal-heading {
  font-size: 17px;
  font-weight: 700;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  color: var(--color-muted);
}
.btn-icon:hover { background: var(--color-bg); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.modal-footer {
  flex-shrink: 0;
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
}

.filter-checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
}
.filter-checkbox-label input { width: 18px; height: 18px; cursor: pointer; }

.filter-section { display: flex; flex-direction: column; gap: var(--space-2); }
.filter-section-label { font-size: 13px; font-weight: 600; color: var(--color-muted); }
.filter-section select { width: 100%; padding: 10px 12px; height: 44px; font-size: 14px; }

.btn-ghost {
  flex: 1;
  height: 44px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--color-surface);
}
.btn-ghost:hover { background: var(--color-bg); }

.btn-primary-sm {
  flex: 1;
  height: 44px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
}
.btn-primary-sm:hover { background: var(--color-primary-2); }

/* 保存済みリスト */
.saved-list { display: flex; flex-direction: column; gap: var(--space-2); }

.saved-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--color-surface);
}
.saved-item:hover { background: var(--color-bg); }

.saved-item-img {
  width: 56px; height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--color-bg);
  flex-shrink: 0;
}

.saved-item-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-empty {
  text-align: center;
  color: var(--color-muted);
  font-size: 14px;
  padding: var(--space-8) 0;
}

/* 保存済み共有セクション */
.saved-share-section {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.saved-share-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  align-self: flex-start;
  margin: 0;
}

.saved-share-sub {
  font-size: 13px;
  color: var(--color-muted);
  align-self: flex-start;
  margin: 0;
  margin-top: calc(-1 * var(--space-2));
}

.saved-qr-img {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
}

.saved-share-actions {
  display: flex;
  gap: var(--space-3);
  width: 100%;
}

.btn-copy-link {
  flex: 1;
  height: 44px;
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-surface);
}
.btn-copy-link:hover { background: var(--color-bg); }

.btn-open-list {
  flex: 1;
  height: 44px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.btn-open-list:hover { background: var(--color-primary-2); }

/* ============================================================
   バックドロップ
   ============================================================ */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(31,41,36,.4);
  backdrop-filter: blur(2px);
}

/* ============================================================
   トースト
   ============================================================ */
.toast-region {
  position: fixed;
  bottom: calc(40vh + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  padding: 10px 20px;
  background: var(--color-text);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  animation: toast-in 0.25s ease;
  pointer-events: auto;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 候補に戻るボタン */
.btn-back-list {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  width: 100%;
  border-bottom: 1px solid var(--color-border);
}
.btn-back-list:hover { background: var(--color-bg); }

/* ============================================================
   PC レイアウト (768px: タブレット)
   ============================================================ */
@media (min-width: 768px) {
  .detail-dialog {
    max-width: 540px;
    right: 0;
    left: auto;
    top: auto;
    height: 92dvh;
  }
  .detail-dialog.open { transform: translateY(8%); }
}

/* ============================================================
   PC レイアウト (1024px: 左パネル + 右地図)
   ============================================================ */
@media (min-width: 1024px) {
  :root {
    --header-h: 64px;
  }

  .app-logo { font-size: 20px; }

  body { overflow: hidden; }

  .explorer-layout {
    display: flex;
    flex-direction: row;
    height: calc(100dvh - var(--header-h) - var(--filter-h));
    overflow: hidden;
    position: static;
  }

  /* 地図パネル: 右側、固定 */
  .map-panel {
    position: relative; /* PC では static でなく relative で overlay を保持 */
    order: 2;
    flex: 1;
    height: 100%;
  }

  /* 候補パネル: 左側、スクロール */
  .results-panel {
    position: static;
    order: 1;
    width: 360px;
    flex-shrink: 0;
    height: 100%;
    transform: none !important;
    border-radius: 0;
    box-shadow: none;
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    padding-bottom: 0;
  }

  .sheet-handle-area { display: none; }

  /* カードカルーセル: 縦リストに */
  .card-carousel {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: visible;
    scroll-snap-type: none;
    padding: var(--space-2) var(--space-3) var(--space-4);
  }

  .spot-card {
    scroll-snap-align: none;
    flex: none;
    width: 100%;
  }

  .card-img-wrap { width: 100px; height: 76px; }

  /* カルーセルナビ: PC では非表示 */
  .carousel-nav { display: none !important; }

  /* PC詳細パネル */
  .pc-detail-panel:not([hidden]) {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
  }
  .pc-detail-panel .detail-content {
    overflow-y: auto;
  }

  /* モバイル詳細ダイアログ: PCでは非表示 */
  .detail-dialog { display: none !important; }

  .toast-region {
    bottom: 32px;
  }
}

/* ============================================================
   PC ワイド (1280px)
   ============================================================ */
@media (min-width: 1280px) {
  .results-panel { width: 420px; }
}

/* ============================================================
   アクセシビリティ: prefers-reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .results-panel,
  .detail-dialog,
  .toast { transition: none; animation: none; }
}
