.cd-map {
  position: relative;
  min-height: 500px;
  height: clamp(500px, calc(100dvh - 170px), 800px);
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line, #d8e0d8);
  border-radius: 18px;
  background-color: #e5ebe5;
  background-image: linear-gradient(rgb(23 60 50 / 4%) 1px, transparent 1px), linear-gradient(90deg, rgb(23 60 50 / 4%) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--ink, #173c32);
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.cd-map *, .cd-map *::before, .cd-map *::after { box-sizing: border-box; }
.cd-map button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cd-map button:disabled { cursor: default; opacity: .4; }
.cd-map:focus-visible { outline: 3px solid var(--accent, #276b52); outline-offset: 3px; }
.cd-map button:focus-visible, .cd-map a:focus-visible { outline: 3px solid var(--accent, #276b52); outline-offset: 3px; }
.cd-map [hidden] { display: none !important; }
.cd-map-dragging, .cd-map-dragging * { cursor: grabbing !important; }
.cd-map-tiles, .cd-map-markers { position: absolute; inset: 0; }
.cd-map-tiles { overflow: hidden; touch-action: none; }
.cd-map .cd-map-tile { position: absolute; width: 256px; height: 256px; max-width: none; opacity: 0; transition: opacity .16s ease; pointer-events: none; }
.cd-map .cd-map-tile[data-state="ready"] { opacity: 1; }
.cd-map-markers { z-index: 2; pointer-events: none; }
.cd-map-heading {
  position: absolute; z-index: 4; top: 18px; left: 18px;
  display: flex; align-items: flex-start; gap: 10px; max-width: calc(100% - 100px);
  padding: 11px 14px; border: 1px solid var(--line, #d8e0d8); border-radius: 10px;
  background: var(--surface, #fffdf8); box-shadow: 0 3px 14px rgb(22 47 37 / 6%);
  font-size: 13px; line-height: 1.4; font-weight: 650; pointer-events: none;
}
.cd-map-area-symbol { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; border: 1.5px dashed var(--accent, #276b52); border-radius: 50%; background: var(--accent-soft, #e4eee5); }
.cd-map-count { display: block; margin-top: 3px; color: var(--muted, #67756b); font-size: 11px; font-weight: 450; }
.cd-map-key { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 7px; color: var(--muted, #67756b); font-size: 10px; font-weight: 500; }
.cd-map-key > span { display: inline-flex; align-items: center; gap: 5px; }
.cd-map-key i { display: inline-block; width: 10px; height: 10px; border: 1px dashed currentColor; border-radius: 50%; background: var(--accent-soft, #e4eee5); }
.cd-map-key .cd-map-key-operated { border: 1px solid #173c32; background: #d5ba7e; box-shadow: inset 0 0 0 2px #173c32; }
.cd-map-controls { position: absolute; z-index: 5; top: 18px; right: 18px; display: grid; gap: 0; width: 44px; overflow: hidden; border: 1px solid var(--line, #d8e0d8); border-radius: 10px; box-shadow: 0 3px 14px rgb(22 47 37 / 9%); }
.cd-map-controls button { display: grid; place-items: center; width: 42px; height: 43px; padding: 0; border: 0; background: var(--surface, #fffdf8); color: var(--ink, #173c32); font-size: 25px; line-height: 1; }
.cd-map-controls button + button { border-top: 1px solid var(--line, #d8e0d8); }
.cd-map-controls button:hover:not(:disabled) { background: var(--accent-soft, #e4eee5); }
.cd-map-controls .cd-map-reset { height: 36px; font-size: 10px; font-weight: 750; letter-spacing: .04em; }
.cd-map-marker { position: absolute; z-index: 1; transform: translate(-50%, -50%); display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 24px; background: transparent; color: #1d4538; pointer-events: auto; }
.cd-map-marker:hover, .cd-map-marker:focus-visible, .cd-map-selected { z-index: 3; }
.cd-map-marker-label { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 42px; min-height: 34px; padding: 7px 11px; border: 1px solid rgb(32 76 59 / 25%); border-radius: 24px; background: #fffdf8; box-shadow: 0 2px 7px rgb(23 60 50 / 16%); font-size: 12px; font-weight: 750; letter-spacing: -.02em; transition: transform .16s ease, box-shadow .16s ease; white-space: nowrap; }
.cd-map-cluster .cd-map-marker-label { min-width: 44px; min-height: 44px; padding: 10px; border: 5px solid #f6f4eccc; background: #244e3d; color: #fff; box-shadow: 0 0 0 1px rgb(36 78 61 / 30%), 0 2px 12px rgb(23 60 50 / 18%); }
.cd-map-operated .cd-map-marker-label { background: #173c32; color: #fffdf8; border-color: #173c32; }
.cd-map-operated-dot { display: block; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #d5ba7e; box-shadow: 0 0 0 2px rgb(255 255 255 / 10%); }
.cd-map-marker:hover .cd-map-marker-label, .cd-map-selected .cd-map-marker-label { transform: translateY(-2px); box-shadow: 0 0 0 3px rgb(184 92 56 / 28%), 0 5px 15px rgb(23 60 50 / 22%); }
.cd-map-selected .cd-map-marker-label { border-color: #b85c38; }
.cd-map-radius { position: absolute; width: var(--cd-area-size, 60px); height: var(--cd-area-size, 60px); border: 1.5px dashed #386d56; border-radius: 50%; background: rgb(67 126 85 / 13%); box-shadow: inset 0 0 18px rgb(67 126 85 / 5%); pointer-events: none; }
.cd-map-operated .cd-map-radius { border-style: solid; background: rgb(41 101 69 / 18%); }
.cd-map-selected .cd-map-radius { border: 2px solid #b85c38; background: rgb(184 92 56 / 13%); }
.cd-map-privacy { position: absolute; z-index: 4; left: 16px; bottom: 65px; display: flex; align-items: flex-start; gap: 9px; max-width: 290px; padding: 11px 13px; border: 1px solid var(--line, #d8e0d8); border-radius: 10px; background: var(--surface, #fffdf8); box-shadow: 0 3px 14px rgb(22 47 37 / 5%); pointer-events: none; font-size: 11px; line-height: 1.4; font-weight: 650; }
.cd-map-privacy svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.cd-map-privacy small { display: block; max-width: 220px; margin-top: 3px; font-size: 10px; line-height: 1.5; font-weight: 400; color: var(--muted, #67756b); }
.cd-map-attribution { position: absolute; z-index: 5; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 3px 7px; border-radius: 4px 0 0 0; background: rgb(255 255 255 / 94%); color: #32453e; cursor: default; }
.cd-map-attribution > a { flex: 0 0 72px; }
.cd-map-attribution img { display: block; width: 72px; height: auto; max-width: 100%; }
.cd-map-attribution span { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 7px; min-width: 0; font-size: 10px; line-height: 1.5; text-align: right; }
.cd-map-attribution span a { white-space: nowrap; }
.cd-map-attribution a { color: #32453e; text-decoration: none; }
.cd-map-attribution a:hover { text-decoration: underline; }
.cd-map-error { position: absolute; z-index: 6; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 10px; width: min(290px, calc(100% - 36px)); padding: 22px; border: 1px solid var(--line, #d8e0d8); border-radius: 14px; background: var(--surface, #fffdf8); box-shadow: 0 10px 35px rgb(23 60 50 / 12%); text-align: center; cursor: default; }
.cd-map-error strong { font-size: 15px; }
.cd-map-error span { color: var(--muted, #67756b); font-size: 12px; line-height: 1.6; }
.cd-map-error button { padding: 8px 14px; border: 1px solid var(--line, #d8e0d8); border-radius: 7px; background: var(--accent-soft, #e4eee5); color: var(--ink, #173c32); font-size: 12px; font-weight: 650; }
.cd-map[data-map-state="partial"] .cd-map-error { top: auto; left: 50%; bottom: 125px; transform: translateX(-50%); padding: 12px 16px; gap: 6px; }
.cd-map[data-map-state="error"] .cd-map-markers { visibility: hidden; }
.cd-map-hint { position: absolute; z-index: 7; left: 50%; bottom: 145px; transform: translateX(-50%); max-width: calc(100% - 40px); padding: 10px 14px; border-radius: 8px; background: rgb(23 60 50 / 94%); color: #fffdf8; font-size: 12px; line-height: 1.5; text-align: center; pointer-events: none; }
.cd-map-popover { position: absolute; z-index: 8; width: 290px; max-width: calc(100% - 24px); padding: 14px; border: 1px solid var(--line, #d8e0d8); border-radius: 13px; background: var(--surface, #fffdf8); box-shadow: 0 12px 35px rgb(23 60 50 / 19%); cursor: default; }
.cd-map-popover-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; }
.cd-map-popover-close { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; color: var(--ink, #173c32); background: var(--accent-soft, #e4eee5); font-size: 22px !important; }
.cd-map-popover p { margin: 5px 0 12px; color: var(--muted, #67756b); font-size: 11px; line-height: 1.5; }
.cd-map-popover-list { display: grid; gap: 4px; max-height: 220px; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
.cd-map-popover-place { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 10px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--ink, #173c32); text-align: left; font-size: 12px !important; line-height: 1.5; }
.cd-map-popover-place:hover { background: var(--accent-soft, #e4eee5); }
.cd-map-popover-place strong { flex: 0 0 auto; }
.cd-map-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[data-theme="night"] .cd-map { background-color: #19372d; background-image: linear-gradient(rgb(234 240 226 / 4%) 1px, transparent 1px), linear-gradient(90deg, rgb(234 240 226 / 4%) 1px, transparent 1px); }
[data-theme="night"] .cd-map-radius { border-color: #bad6bb; background: rgb(159 206 160 / 14%); }
[data-theme="night"] .cd-map-selected .cd-map-radius { border-color: #e0a483; background: rgb(224 164 131 / 16%); }
[data-theme="night"] .cd-map-operated .cd-map-marker-label { border-color: #bed8bc; background: #e4edda; color: #173c32; }
[data-theme="night"] .cd-map-operated-dot { background: #975c32; }
@media (max-width: 620px) {
  .cd-map { min-height: 500px; height: min(70dvh, 620px); border-radius: 14px; }
  .cd-map-heading { top: 12px; left: 12px; max-width: calc(100% - 78px); padding: 9px 11px; font-size: 12px; }
  .cd-map-controls { top: 12px; right: 12px; }
  .cd-map-privacy { left: 12px; bottom: 63px; max-width: calc(100% - 24px); padding: 9px 11px; }
  .cd-map-privacy small { max-width: 230px; }
  .cd-map-attribution { gap: 7px; }
  .cd-map-attribution > a { flex-basis: 72px; }
  .cd-map-attribution img { width: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .cd-map .cd-map-tile, .cd-map-marker-label { transition: none; }
}

#directory-map.cd-map { height: 100%; min-height: 0; border: 0; border-radius: 0; }
#directory-map .cd-map-privacy { display: none; }
#directory-map .cd-map-heading { top: auto; bottom: 96px; left: 18px; max-width: calc(100% - 36px); padding: 7px 10px; border-radius: 7px; box-shadow: none; }
#directory-map .cd-map-area-symbol, #directory-map .cd-map-count { display: none; }
#directory-map .cd-map-heading > span:last-child { font-size: 0; line-height: 0; }
#directory-map .cd-map-key { margin-top: 0; font-size: 10px; line-height: 1.4; }
@media (max-width: 620px) {
  #directory-map .cd-map-heading { bottom: 156px; left: 12px; max-width: calc(100% - 24px); }
}
