/* ===============================
   天文館ナイトマップ - スタイルシート
   =============================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #0f1117;
  --color-bg2: #181c27;
  --color-bg3: #1e2335;
  --color-surface: #252b3d;
  --color-border: #2e3650;
  --color-text: #e8eaf0;
  --color-text-muted: #8891ab;
  --color-text-sub: #a0aabe;
  --color-accent: #f9c035;
  --color-accent2: #4f8ef7;
  --color-success: #2dc653;
  --color-danger: #e85d04;
  --color-map: #3a9bdc;
  --color-navi: #1aaf5d;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.3);
  --transition: 0.2s ease;
  --header-h: 64px;
  --filter-h: 52px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans JP', sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ===============================
   ヘッダー
   =============================== */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg2);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-h);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-icon {
  font-size: 2rem;
  line-height: 1;
}

.header-title h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 0.05em;
}

.header-sub {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===============================
   ボタン共通
   =============================== */
.btn-primary {
  background: var(--color-accent);
  color: #1a1600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  font-family: inherit;
}
.btn-primary:hover { background: #ffd14f; transform: translateY(-1px); }

.btn-secondary {
  background: transparent;
  color: var(--color-text-sub);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  font-family: inherit;
}
.btn-secondary:hover { border-color: var(--color-text-sub); color: var(--color-text); }

.btn-danger {
  background: transparent;
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  font-family: inherit;
}
.btn-danger:hover { background: var(--color-danger); color: white; }

.btn-icon {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}
.btn-icon:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ===============================
   フィルターバー
   =============================== */
#filter-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: var(--color-bg2);
  border-bottom: 1px solid var(--color-border);
}

.filter-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-inner::-webkit-scrollbar { display: none; }

.filter-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-sub);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  font-family: inherit;
}
.filter-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.filter-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #1a1600;
  font-weight: 700;
}

/* ===============================
   メインコンテンツ
   =============================== */
#main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* ===============================
   検索バー
   =============================== */
#search-bar {
  margin-bottom: 20px;
}

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

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

#search-input {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-size: 0.95rem;
  padding: 11px 44px 11px 40px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}
#search-input:focus {
  border-color: var(--color-accent2);
  box-shadow: 0 0 0 3px rgba(79,142,247,0.15);
}
#search-input::placeholder { color: var(--color-text-muted); }

.search-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
  transition: var(--transition);
}
.search-clear:hover { color: var(--color-text); }

.result-count {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  padding-left: 4px;
}

/* ===============================
   店舗カードグリッド
   =============================== */
#store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ===============================
   店舗カード
   =============================== */
.store-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.store-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(249,192,53,0.4);
}

.store-card:focus {
  outline: 2px solid var(--color-accent2);
  outline-offset: 2px;
}

/* カラーバー */
.card-color-bar {
  height: 4px;
  width: 100%;
}

.card-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.card-number {
  background: var(--color-bg3);
  color: var(--color-text-muted);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  margin-top: 2px;
}

.card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  flex: 1;
}

.card-genre {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--color-text-sub);
  margin-bottom: 6px;
}

.card-note {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

.card-budget {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}
.card-budget strong { color: var(--color-accent); }

.card-map-btn {
  background: var(--color-map);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  transition: var(--transition);
  font-weight: 600;
  font-family: inherit;
}
.card-map-btn:hover { background: #2a7bbf; }

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.tag {
  background: var(--color-bg3);
  color: var(--color-text-muted);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
}

/* ===============================
   検索結果なし
   =============================== */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}
.no-results i {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
  opacity: 0.4;
}
.no-results p { margin-bottom: 16px; }

/* ===============================
   モーダル共通
   =============================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-container {
  background: var(--color-bg2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--color-bg3);
  border: none;
  color: var(--color-text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 10;
  font-size: 0.9rem;
}
.modal-close:hover { background: var(--color-danger); color: white; }

/* ===============================
   店舗詳細モーダル
   =============================== */
.modal-header {
  padding: 28px 28px 20px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg3);
}

.modal-number {
  display: inline-block;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}

.modal-genre-icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 6px;
}

.modal-store-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}

.modal-genre-label {
  background: var(--color-surface);
  color: var(--color-text-sub);
  font-size: 0.8rem;
  padding: 3px 12px;
  border-radius: 10px;
}

.modal-body {
  padding: 20px 24px 24px;
}

.modal-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.info-icon {
  color: var(--color-accent);
  font-size: 0.85rem;
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.info-label {
  display: block;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.info-value {
  font-size: 0.88rem;
  color: var(--color-text);
  line-height: 1.4;
}

.info-link {
  color: var(--color-accent2);
  text-decoration: none;
}
.info-link:hover { text-decoration: underline; }

/* プチ情報ボックス */
.modal-note-box {
  background: var(--color-bg3);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.note-header {
  font-size: 0.78rem;
  color: var(--color-accent);
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.modal-note {
  font-size: 0.88rem;
  color: var(--color-text-sub);
  line-height: 1.7;
}

/* モーダルタグ */
.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

/* モーダルアクションボタン */
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-map {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px;
  background: var(--color-map);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}
.btn-map:hover { background: #2a7bbf; transform: translateY(-1px); }

.btn-navi {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  background: transparent;
  color: var(--color-navi);
  border: 1px solid var(--color-navi);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}
.btn-navi:hover { background: var(--color-navi); color: white; }

.btn-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px;
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-edit:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ===============================
   編集モーダル
   =============================== */
.modal-edit-container {
  max-width: 640px;
}

.edit-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  padding: 24px 24px 0;
  margin-bottom: 20px;
  color: var(--color-text);
}

.store-form {
  padding: 0 24px 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.form-full {
  grid-column: 1 / -1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.82rem;
  color: var(--color-text-sub);
  font-weight: 500;
}

.required {
  color: var(--color-danger);
}

.form-group input,
.form-group textarea {
  background: var(--color-bg3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  padding: 9px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-accent2);
  box-shadow: 0 0 0 3px rgba(79,142,247,0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-muted);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

/* ===============================
   トースト通知
   =============================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  z-index: 300;
  transition: transform 0.3s ease;
  white-space: nowrap;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}
.toast.success { border-left: 3px solid var(--color-success); }
.toast.error { border-left: 3px solid var(--color-danger); }

/* ===============================
   スクロールトップ
   =============================== */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 150;
  box-shadow: var(--shadow-card);
}
.scroll-top:hover {
  background: var(--color-accent);
  color: #1a1600;
  border-color: var(--color-accent);
}

/* ===============================
   フッター
   =============================== */
#site-footer {
  text-align: center;
  padding: 20px;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg2);
}

/* ===============================
   アニメーション
   =============================== */
.store-card {
  animation: cardIn 0.3s ease both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===============================
   レスポンシブ
   =============================== */
@media (max-width: 768px) {
  :root {
    --header-h: 56px;
  }

  .header-title h1 { font-size: 1.05rem; }
  .header-icon { font-size: 1.5rem; }
  .header-sub { display: none; }

  /* マップモード時の検索バー調整 */
  #main-content.map-mode #search-bar {
    padding: 10px 12px 0;
  }
  #main-content.map-mode .map-hint {
    padding: 5px 12px 6px;
    font-size: 0.72rem;
  }

  #store-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .modal-info-grid {
    grid-template-columns: 1fr;
  }

  .modal-header { padding: 20px 20px 16px; }
  .modal-body { padding: 16px 18px 20px; }
  .modal-store-name { font-size: 1.25rem; }

  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-full {
    grid-column: 1;
  }

  .edit-modal-title { padding: 20px 18px 0; }
  .store-form { padding: 0 18px 20px; }
}

@media (max-width: 480px) {
  #store-grid {
    grid-template-columns: 1fr;
  }

  .header-actions .btn-primary span { display: none; }

  .modal-container {
    max-height: 95vh;
  }

  .form-actions {
    flex-direction: column;
  }
  .form-actions button { width: 100%; justify-content: center; }
}

/* スクロールバーカスタム */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }

/* ===============================
   ビュー切り替えトグル
   =============================== */
.view-toggle {
  display: flex;
  background: var(--color-bg3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-toggle-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: var(--transition);
}
.view-toggle-btn:hover { color: var(--color-text); }
.view-toggle-btn.active {
  background: var(--color-accent);
  color: #1a1600;
}

/* ===============================
   マップビュー
   =============================== */

/* マップ表示中はmain-contentのpaddingを上書き */
#main-content.map-mode {
  padding: 0;
  max-width: 100%;
}
#main-content.map-mode #search-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 16px 0;
}
#main-content.map-mode .map-hint {
  max-width: 1200px;
  margin: 0 auto;
  padding: 7px 16px 8px;
}

#map-view {
  width: 100%;
}

#map-container {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
  /* PC: ヘッダー+フィルター+検索バー分を引いた残り高さ */
  height: calc(100dvh - var(--header-h) - 52px - 70px - 36px);
  min-height: 360px;
  max-height: 640px;
}

#map {
  flex: 1;
  min-width: 0;
  min-height: 0;
  z-index: 1;
}

/* Leaflet上書き */
.leaflet-container {
  background: #1a2030 !important;
  font-family: 'Noto Sans JP', sans-serif !important;
  height: 100% !important;
  width: 100% !important;
}

.map-hint {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  padding: 7px 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
#map-center-label { color: var(--color-accent); }

/* ===============================
   マップ ピンアイコン
   =============================== */
.map-pin {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
  transition: transform 0.15s ease;
}
.map-pin:hover { transform: rotate(-45deg) scale(1.15); }

.map-pin-number {
  transform: rotate(45deg);
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  position: absolute;
  top: 2px;
  right: 3px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.map-pin-icon {
  transform: rotate(45deg);
  font-size: 1.1rem;
  line-height: 1;
}

.map-pin-tail {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid;
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
}

/* センテラスピン */
.map-center-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}
.map-center-star { font-size: 2rem; line-height: 1; }
.map-center-label {
  background: rgba(15,17,23,0.85);
  color: var(--color-accent);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
}

/* ===============================
   マップ ポップアップ
   =============================== */
.map-popup .leaflet-popup-content-wrapper {
  background: #1e2335 !important;
  border: 1px solid #2e3650 !important;
  border-radius: 10px !important;
  box-shadow: 0 6px 24px rgba(0,0,0,0.6) !important;
  padding: 0 !important;
  overflow: hidden;
}
.map-popup .leaflet-popup-tip-container { display: none; }
.map-popup .leaflet-popup-content { margin: 0 !important; width: auto !important; }

.map-popup-inner { padding: 12px 14px; }

.map-popup-header {
  padding-left: 8px;
  margin-bottom: 8px;
}
.map-popup-num {
  display: block;
  font-size: 0.68rem;
  color: #8891ab;
  font-weight: 700;
  margin-bottom: 2px;
}
.map-popup-name {
  display: block;
  font-size: 1rem;
  color: #e8eaf0;
  font-weight: 700;
  margin-bottom: 2px;
}
.map-popup-genre {
  display: block;
  font-size: 0.75rem;
  color: #a0aabe;
}

.map-popup-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  color: #a0aabe;
}

.map-popup-actions {
  display: flex;
  gap: 6px;
}

.map-popup-btn-detail {
  flex: 1;
  background: #4f8ef7;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 7px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: 'Noto Sans JP', sans-serif;
  transition: background 0.15s;
}
.map-popup-btn-detail:hover { background: #2a7bbf; }

.map-popup-btn-navi {
  background: transparent;
  color: #1aaf5d;
  border: 1px solid #1aaf5d;
  border-radius: 6px;
  padding: 7px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.map-popup-btn-navi:hover { background: #1aaf5d; color: white; }

/* Leaflet閉じるボタン */
.map-popup .leaflet-popup-close-button {
  color: #8891ab !important;
  font-size: 18px !important;
  padding: 6px !important;
}

/* スマホ向けポップアップ */
@media (max-width: 768px) {
  .map-popup .leaflet-popup-content-wrapper {
    max-width: calc(100vw - 40px) !important;
  }
  .map-popup-inner { padding: 10px 12px; }
  .map-popup-name { font-size: 0.92rem; }
  .map-popup-actions { flex-direction: column; gap: 5px; }
  .map-popup-btn-detail,
  .map-popup-btn-navi { justify-content: center; padding: 9px 8px; }
}

/* ===============================
   マップ サイドバー
   =============================== */
#map-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--color-bg2);
  border-left: 1px solid var(--color-border);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

#map-sidebar-list {
  padding: 8px 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--color-border);
}
.sidebar-item:last-child { border-bottom: none; }
.sidebar-item:hover { background: var(--color-bg3); }
.sidebar-item.active { background: rgba(249,192,53,0.1); border-left: 3px solid var(--color-accent); }

.sidebar-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-info {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.sidebar-icon { font-size: 0.9rem; flex-shrink: 0; }

.sidebar-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-genre {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-empty {
  text-align: center;
  padding: 20px 12px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ===============================
   レスポンシブ (マップ)
   =============================== */
@media (max-width: 768px) {
  /* スマホ: 縦積みレイアウト・高さを動的に計算 */
  #map-container {
    flex-direction: column;
    /* ヘッダー(56px) + フィルター(52px) + 検索バー(~62px) + サイドリスト(~140px) + hint(28px) */
    height: auto;
    min-height: unset;
    max-height: unset;
    border-left: none;
    border-right: none;
    border-radius: 0;
  }

  #map {
    /* スマホ画面の約50%を地図に割り当て */
    height: calc(100dvh - 56px - 52px - 60px - 150px - 28px);
    min-height: 240px;
    max-height: 400px;
    flex-shrink: 0;
  }

  #map-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--color-border);
    max-height: 150px;
    min-height: 100px;
    overflow-y: hidden;
    overflow-x: auto;
    flex-shrink: 0;
  }

  #map-sidebar-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 8px;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #map-sidebar-list::-webkit-scrollbar { display: none; }

  .sidebar-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 74px;
    max-width: 74px;
    flex-shrink: 0;
    padding: 7px 5px;
    border-bottom: none;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
  }
  .sidebar-item.active {
    border-color: var(--color-accent);
    border-left: 1px solid var(--color-accent);
    background: rgba(249,192,53,0.12);
  }

  .sidebar-info { flex-direction: column; align-items: center; gap: 1px; }
  .sidebar-icon { font-size: 1rem; }
  .sidebar-name { font-size: 0.68rem; white-space: normal; line-height: 1.2; text-align: center; }
  .sidebar-genre { display: none; }
  .sidebar-num { width: 22px; height: 22px; font-size: 0.62rem; }
}

@media (max-width: 480px) {
  #map {
    height: calc(100dvh - 56px - 52px - 58px - 140px - 28px);
    min-height: 220px;
    max-height: 340px;
  }
  #map-sidebar { max-height: 130px; }
  .sidebar-item { min-width: 66px; max-width: 66px; }
  .sidebar-name { font-size: 0.64rem; }
}
