* { box-sizing: border-box; }
html, body { margin: 0; height: 100dvh; font: 14px/1.4 system-ui, sans-serif; }

#map { position: fixed; inset: 0; width: 100%; height: 100dvh; }

#filters {
  position: absolute; top: 12px; left: 60px; z-index: 1000;
  background: #fff; padding: 8px 10px; border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
  display: flex; flex-direction: column; gap: 6px;
  width: 340px; font-size: 13px;
}
.lang-toggle {
  position: absolute; bottom: 8px; right: 10px;
  display: inline-flex; border: 1px solid #ddd; border-radius: 12px;
  overflow: hidden; font-size: 11px;
}
.lang-toggle button {
  border: 0; background: #fff; padding: 3px 8px; cursor: pointer;
  color: #888; font: inherit;
}
.lang-toggle button.active { background: #e6537a; color: #fff; }
#filters .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#filters .row label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
#date-val { min-width: 3em; }
#date-slider { flex: 1; }
.legend { display: flex; gap: 10px; font-size: 11px; margin-top: 4px;
  flex-wrap: wrap; padding-right: 95px; }
.legend span { display: flex; align-items: center; gap: 3px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
@media (max-width: 600px) {
  #filters { left: 8px; right: 8px; width: auto; }
}

#detail {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 1001;
  width: 360px; max-width: 90vw;
  background: #fff; box-shadow: -2px 0 12px rgba(0,0,0,.2);
  padding: 16px; overflow-y: auto;
  transform: translateX(0); transition: transform .2s ease;
}
#detail[hidden] { display: block; transform: translateX(100%); }
#detail-close {
  position: absolute; top: 8px; right: 8px;
  border: 0; background: none; font-size: 24px; cursor: pointer;
}
#detail h2 { margin: 8px 0 2px; font-size: 18px; }
#d-sub { font-size: 12px; color: #888; margin-bottom: 12px; }
#d-img { width: 100%; border-radius: 4px; margin-bottom: 8px; }
#d-timeline {
  background: #fff5f8; padding: 6px 8px; border-radius: 4px;
  font-size: 13px; margin-bottom: 8px;
}
#d-reinen, #d-tree, #d-midokoro, #d-access {
  font-size: 13px; color: #444; margin-bottom: 6px;
}
#d-info { font-size: 13px; color: #444; margin: 8px 0; }
#d-info > div { margin-bottom: 4px; }
#d-info a { color: #e6537a; text-decoration: none; }
#d-info a:hover { text-decoration: underline; }
#d-badges { margin: 8px 0; }
#d-badges .badge {
  display: inline-block; padding: 2px 8px; margin: 0 4px 4px 0;
  background: #fff5f8; color: #e6537a; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
#d-link { display: block; margin-top: 8px; color: #e6537a; text-decoration: none; }
#d-link:hover { text-decoration: underline; }
#d-gmaps, #d-share { margin-left: 6px; text-decoration: none; font-size: 0.85em;
  vertical-align: 2px; opacity: .7; border: 0; background: none; padding: 0;
  cursor: pointer; font-family: inherit; }
#d-gmaps:hover, #d-share:hover { opacity: 1; }

#d-obs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 8px 0; font-size: 14px; font-weight: 600; }
#d-obs img { flex-shrink: 0; }
.obs-bar { flex-basis: 100%; height: 8px; background: #eee; border-radius: 4px; overflow: hidden; }
.obs-bar > div { height: 100%; transition: width .3s; }

#d-timeline { background: none; padding: 12px 0; }
.tl-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.tl-bar > div { height: 100%; }
.tl-ticks { position: relative; height: 32px; font-size: 10px; }
.tl-tick { position: absolute; transform: translateX(-50%); text-align: center; white-space: nowrap; }
.tl-tick b { display: block; }
.tl-today { position: absolute; top: -14px; transform: translateX(-50%); color: #e6537a; }

.pin {
  width: var(--pin-size, 36px); height: var(--pin-size, 36px);
  border-radius: 50%;
  border: 3px solid var(--c, #bbb);
  background: #fff center/cover;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: width .15s, height .15s;
}
.pin img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.jma-pin { width: 20px; height: 20px; font-size: 18px; cursor: pointer;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
  -webkit-text-stroke: 1px #fff; }
