* {
  box-sizing: border-box;
}

.public-footer {
  position: fixed;
  z-index: 900;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.public-footer a { color: #1b3a4b; }

.info-page {
  overflow: auto;
  background: #f5f7f8;
  color: #263238;
  line-height: 1.7;
}

.info-page main {
  max-width: 720px;
  margin: 32px auto;
  padding: 24px;
  border-radius: 12px;
  background: #fff;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}

#map {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

/* 現在地ボタン */
#locate-btn {
  position: fixed;
  right: 12px;
  bottom: calc(120px + env(safe-area-inset-bottom));
  z-index: 500;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#locate-btn:active {
  background: #e0e0e0;
}

/* 検索パネル */
#search-panel {
  position: fixed;
  top: env(safe-area-inset-top);
  left: 8px;
  right: 8px;
  z-index: 600;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px;
  margin-top: 8px;
}

#search-panel.hidden {
  display: none;
}

#search-input {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

#search-results {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
}

#search-results li {
  padding: 10px 8px;
  border-bottom: 1px solid #eee;
  font-size: 15px;
}

#search-results li .spot-pref {
  color: #888;
  font-size: 13px;
  margin-left: 6px;
}

#search-results li:active {
  background: #f0f0f0;
}

/* フィルタバー */
#filter-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  background: rgba(27, 58, 75, 0.95);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom)) 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.toggle-btn,
.rating-btn,
#search-toggle-btn {
  flex: 1;
  min-width: 0;
  padding: 10px 4px;
  border: none;
  border-radius: 8px;
  background: #345a70;
  color: #cfd8dc;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.toggle-btn.active {
  background: #ffffff;
  color: #1b3a4b;
}

.rating-btn.active {
  background: #ffcc66;
  color: #1b3a4b;
}

#search-toggle-btn {
  flex: 0 0 48px;
}

/* Leafletポップアップ内 */
.spot-popup h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
}

.spot-popup .spot-type {
  color: #666;
  font-size: 13px;
  margin-bottom: 6px;
}

.spot-popup .spot-rating {
  color: #d9820a;
  font-weight: 600;
  margin-bottom: 6px;
}

.spot-popup .spot-links a {
  display: inline-block;
  margin-right: 10px;
  color: #1a73e8;
  text-decoration: none;
  font-size: 14px;
}

.spot-popup .nearby-onsen {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.spot-popup .nearby-onsen h4 {
  margin: 0 0 4px 0;
  font-size: 13px;
  color: #666;
}

.spot-popup .nearby-onsen ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.spot-popup .nearby-onsen li {
  font-size: 13px;
  padding: 3px 0;
}

.spot-popup .nearby-onsen a {
  color: #1a73e8;
  text-decoration: none;
}

.spot-popup .spot-parking {
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
}

.spot-popup .spot-parking-large {
  color: #2e7d32;
  font-weight: 600;
}

.spot-popup .spot-parking-unknown {
  color: #999;
}

.leaflet-popup-content {
  min-width: 200px;
}

/* カスタムマーカー */
.spot-marker-wrapper {
  background: transparent;
  border: none;
}

.spot-marker {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  border: 2px solid #ffffff;
  font-size: 15px;
}

.spot-marker::before {
  content: "";
}

.spot-marker {
  color: #ffffff;
}

.spot-marker > * {
  transform: rotate(-45deg);
}

.spot-marker-large-parking {
  width: 34px;
  height: 34px;
  box-shadow: 0 0 0 2px #ffcc00, 0 1px 4px rgba(0, 0, 0, 0.5);
}

.spot-marker .parking-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #ffcc00;
  color: #1b3a4b;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  padding: 2px 3px;
  border-radius: 50%;
  border: 1px solid #ffffff;
  transform: rotate(-45deg);
}

/* Static SEO detail and index pages */
body.seo-page {
  margin: 0;
  min-height: 100%;
  overflow: auto;
  background: #f3f6f7;
  color: #20323b;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
}

.seo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: calc(14px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left));
  background: #1b3a4b;
}

.seo-header a {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.seo-main {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.seo-main h1 {
  margin: 0 0 22px;
  color: #1b3a4b;
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.35;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
  color: #64757e;
  font-size: 12px;
}

.breadcrumbs a,
.related-section a,
.area-group a,
.source-notice a {
  color: #17699a;
}

.item-kicker {
  margin: 0 0 5px;
  color: #e05a2b;
  font-size: 13px;
  font-weight: 700;
}

.page-lead,
.language-notice {
  color: #53666f;
  line-height: 1.7;
}

.language-notice {
  padding: 10px 12px;
  border-left: 3px solid #e05a2b;
  background: #fff;
  font-size: 13px;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 24px;
}

.fact-grid > div {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid #dbe3e6;
  border-radius: 10px;
  background: #fff;
}

.fact-grid dt {
  margin-bottom: 4px;
  color: #64757e;
  font-size: 11px;
}

.fact-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 600;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
}

.primary-action,
.secondary-action {
  display: inline-block;
  padding: 10px 13px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.primary-action {
  color: #fff;
  background: #1b3a4b;
}

.secondary-action {
  color: #1b3a4b;
  border: 1px solid #c9d5da;
  background: #fff;
}

.related-section,
.type-group,
.area-group {
  margin: 28px 0;
}

.related-section h2,
.type-group h2 {
  color: #1b3a4b;
  font-size: 19px;
}

.area-group h3 {
  margin: 18px 0 6px;
  color: #53666f;
  font-size: 14px;
}

.related-section ul,
.area-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-section li,
.area-group li {
  padding: 8px 0;
  border-bottom: 1px solid #dbe3e6;
  overflow-wrap: anywhere;
}

.source-notice {
  margin-top: 32px;
  padding: 14px 16px;
  border-left: 3px solid #e05a2b;
  background: #fff;
  color: #53666f;
  font-size: 12px;
  line-height: 1.7;
}

.source-notice p {
  margin: 5px 0;
}

.seo-footer {
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid #dbe3e6;
  color: #64757e;
  text-align: center;
  font-size: 12px;
}

.seo-footer a {
  color: #1b3a4b;
}

@media (max-width: 520px) {
  .fact-grid {
    grid-template-columns: 1fr;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
    text-align: center;
  }
}
