/* 地図レイヤーフィルター（schedule / worker / admin 共通） */
.map-layer-filter-root {
  position: fixed;
  top: calc(96px + env(safe-area-inset-top, 0px));
  right: 12px;
  z-index: 1800;
  font-family: inherit;
  pointer-events: none;
}

/* アプリ内Googleマップ表示中は、地図の操作ボタンと色分けを重ねない */
html.in-app-gmap-open #mapLayerFilterRoot,
html.in-app-gmap-open .schedule-side-fabs,
html.in-app-gmap-open #scheduleLegendUI,
html.in-app-gmap-open #viewpointToast,
html.in-app-gmap-open #btnCurrentLocation,
html.in-app-gmap-open #btnToggleViewpoint,
html.in-app-gmap-open #btnAdminMaster,
html.in-app-gmap-open #adminRegPlusWrap,
html.in-app-gmap-open #btnClockBoard,
html.in-app-gmap-open #mapActionBar,
html.in-app-gmap-open #workerLegendUI,
html.in-app-gmap-open #adminLegendUI {
  display: none !important;
}

.map-layer-filter-root * {
  box-sizing: border-box;
}

.map-layer-filter-btn {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #37474F;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.map-layer-filter-btn:hover {
  background: #ECEFF1;
}

.map-layer-filter-btn.is-active {
  background: #1565C0;
  color: #fff;
}

.map-layer-filter-btn.is-filtered {
  outline: 2px solid #FF9800;
  outline-offset: 1px;
}

.map-layer-filter-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.map-layer-filter-panel {
  pointer-events: auto;
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(260px, calc(100vw - 24px));
  background: #fff;
  color: #263238;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  padding: 12px;
  border: 1px solid #CFD8DC;
}

.map-layer-filter-panel.is-open {
  display: block;
}

.map-layer-filter-title {
  font-size: 13px;
  font-weight: bold;
  color: #1565C0;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.map-layer-filter-close {
  background: none;
  border: none;
  color: #78909C;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.map-layer-filter-hint {
  font-size: 11px;
  color: #78909C;
  margin: 0 0 10px;
  line-height: 1.4;
}

.map-layer-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}

.map-layer-filter-row:hover {
  background: #F5F7FA;
}

.map-layer-filter-label {
  font-size: 13px;
  font-weight: bold;
  color: #37474F;
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-layer-filter-label span.emoji {
  font-size: 15px;
  width: 1.3em;
  text-align: center;
}

.map-layer-filter-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.map-layer-filter-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.map-layer-filter-slider {
  position: absolute;
  inset: 0;
  background: #B0BEC5;
  border-radius: 999px;
  transition: background 0.18s ease;
  cursor: pointer;
}

.map-layer-filter-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.map-layer-filter-switch input:checked+.map-layer-filter-slider {
  background: #2E7D32;
}

.map-layer-filter-switch input:checked+.map-layer-filter-slider::before {
  transform: translateX(18px);
}

.map-layer-filter-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.map-layer-filter-actions button {
  flex: 1;
  border: 1px solid #CFD8DC;
  background: #F5F7FA;
  color: #455A64;
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

body.ridge-measuring-mode .map-layer-filter-root {
  display: none !important;
}