* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--petmap-font);
  color: #333;
}

button {
  cursor: pointer;
  font-family: inherit;
}

header {
  height: 75px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 25px;
  background: white;
  border-bottom: 1px solid #ddd;
}

.search-box {
  flex: 1;
  display: flex;
}

.search-box input {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px 0 0 8px;
  font-size: 15px;
}

.search-button {
  padding: 10px 18px;
  border: none;
  background: #333;
  color: white;
  border-radius: 0 8px 8px 0;
  font-size: 18px;
}

.login-button,
.menu-button {
  padding: 12px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 8px;
}

.login-button:hover,
.menu-button:hover {
  background: #f2f2f2;
}

.menu-button {
  font-size: 18px;
}

.map-area {
  position: relative;
  height: calc(100vh - 75px);
  background: #eef2f3;
  z-index: 0;
}

#map {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  color: #555;
}

.side-menu {
  position: fixed;
  top: 75px;
  right: 0;
  width: 33.33%;
  height: calc(100vh - 75px);
  padding: 25px;
  background: white;
  box-shadow: -3px 0 12px #0002;
  transform: translateX(105%);
  transition: transform 0.3s ease;
  visibility: hidden;
  z-index: 1000;
  overflow-y: auto;
}

.side-menu.open {
  transform: translateX(0);
  visibility: visible;
}

.side-menu h2 {
  margin-top: 0;
  font-size: 20px;
}

.side-menu a {
  display: block;
  padding: 16px;
  text-decoration: none;
  color: #333;
  border-bottom: 1px solid #eee;
}

.side-menu a:hover {
  background: #f5f5f5;
}

@media (max-width: 600px) {
  header {
    gap: 8px;
    padding: 10px;
  }

  .login-button {
    font-size: 12px;
    padding: 10px 6px;
  }

  .side-menu {
    width: 75%;
  }
}

.current-location-button {
  position: absolute;
  right: 16px;
  bottom: 125px;
  z-index: 12;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 12px;
  border: 1px solid #d7ddd9;
  border-radius: 50%;
  background: white;
  color: #006b3c;
  box-shadow: 0 2px 8px #0003;
}
.current-location-button svg {
  width: 24px;
  height: 24px;
}
.current-location-button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.current-location-button:focus-visible {
  outline: 3px solid #2679df;
  outline-offset: 3px;
}
@media (max-width: 600px) {
  .current-location-button {
    right: 12px;
    bottom: 130px;
  }
}

.current-location-dot {
  width: 18px;
  height: 18px;
  border: 3px solid white;
  border-radius: 50%;
  background: #e53935;
  box-shadow:
    0 0 0 7px #e5393526,
    0 1px 5px #0004;
  pointer-events: none;
}
@supports (height: 100dvh) {
  .map-area {
    height: calc(100dvh - 75px);
  }
}

.map-status {
  position: absolute;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  max-width: 90%;
  padding: 10px 15px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 2px 8px #0002;
  font-size: 13px;
  text-align: center;
}

.map-status:empty {
  display: none;
}

.place-results {
  position: absolute;
  top: 75px;
  left: 15px;
  bottom: 175px;
  z-index: 10;
  width: 280px;
  max-width: calc(100% - 30px);
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px #0002;
  overflow: auto;
}

.place-results-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 15px;
  background: white;
  border-bottom: 1px solid #eee;
}

.place-results-header h2 {
  margin: 0;
  font-size: 15px;
}

.place-results-header button {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
}

.place-results ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.place-result-button {
  display: block;
  width: 100%;
  padding: 14px 15px;
  border: 0;
  border-bottom: 1px solid #eee;
  background: white;
  color: #333;
  text-align: left;
}

.place-result-button:hover,
.place-result-button:focus-visible {
  background: #edf6f0;
}

.place-result-button span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #666;
}

.place-results-empty {
  padding: 15px;
  font-size: 13px;
  color: #666;
}

@media (max-width: 600px) {
  .place-results {
    top: auto;
    bottom: 190px;
    width: calc(100% - 30px);
    max-height: 30%;
  }
}

.map-legend {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 14px 16px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 12px #0002;
}

.map-legend-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}

.legend-dot {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
}

.legend-dot.green {
  background: #00834a;
}
.legend-dot.yellow {
  background: #ffcc00;
}
.legend-dot.gray {
  background: #80818a;
}

.map-legend-note {
  margin: 10px 0 0;
  padding-top: 7px;
  border-top: 1px solid #eee;
  color: #666;
  font-size: 10px;
  text-align: center;
}

@media (max-width: 600px) {
  .map-legend {
    padding: 12px 10px 8px;
  }

  .map-legend-row {
    gap: 10px;
  }
  .map-legend-item {
    gap: 4px;
    font-size: 9px;
  }
  .legend-dot {
    width: 15px;
    height: 15px;
  }
  .map-legend-note {
    font-size: 9px;
  }
}

#map img {
  filter: grayscale(1);
}

.policy-place-label {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  padding: 7px 10px;
  border: 2px solid var(--policy-color);
  border-radius: 18px;
  background: white;
  color: #222;
  box-shadow: 0 2px 6px #0003;
  font-size: 12px;
  font-weight: bold;
}

.policy-place-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-dot.blue {
  background: #2679df;
}
.pet-filter-toggle {
  position: absolute;
  top: 180px;
  left: 15px;
  z-index: 10;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 12px;
  background: white;
}
.pet-filter-panel {
  position: absolute;
  top: 225px;
  left: 15px;
  z-index: 15;
  width: 300px;
  max-width: calc(100% - 30px);
  max-height: calc(100% - 245px);
  overflow: auto;
  padding: 16px;
  border-radius: 14px;
  background: white;
  box-shadow: 0 3px 15px #0003;
}
.pet-filter-panel h2 {
  margin: 0 0 12px;
  font-size: 17px;
}
.pet-filter-panel fieldset {
  margin: 12px 0;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
}
.pet-filter-panel legend {
  font-size: 13px;
  font-weight: bold;
}
.pet-filter-panel [hidden] {
  display: none !important;
}
.pet-filter-panel label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 5px 6px 5px 0;
  font-size: 13px;
}
.pet-filter-panel p {
  font-size: 12px;
  line-height: 1.5;
  color: #555;
}
.pet-species-buttons {
  display: flex;
  gap: 6px;
}
.pet-species-buttons button,
.pet-filter-actions button {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: white;
}
.pet-species-buttons button[aria-pressed="true"] {
  background: #e9eef3;
  border-color: #333;
  font-weight: bold;
}
.pet-filter-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pet-filter-actions .apply-filter {
  background: #006b3c;
  color: white;
}
#applyPetFilters,
#applyPetFilters:hover,
#applyPetFilters:focus-visible {
  color: #fff;
}
.policy-place-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid white;
  background: var(--policy-color);
  box-shadow: 0 1px 4px #0006;
}
@media (max-width: 600px) {
  .pet-filter-panel {
    top: 75px;
    left: 10px;
    max-height: calc(100% - 190px);
  }
}

.pet-species-control {
  position: absolute;
  top: 70px;
  right: 15px;
  z-index: 11;
  max-width: calc(100% - 30px);
}
.pet-species-control .pet-species-buttons {
  width: max-content;
  max-width: 100%;
  margin-left: auto;
  padding: 6px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 2px 8px #0002;
}
.pet-species-buttons [data-pet-species="all"][aria-pressed="true"] {
  background: #00834a;
  border-color: #00834a;
  color: white;
}
.pet-species-buttons [data-pet-species="dog"][aria-pressed="true"] {
  background: #2679df;
  border-color: #2679df;
  color: white;
}
.pet-species-buttons [data-pet-species="cat"][aria-pressed="true"] {
  background: #ffcf24;
  border-color: #d9b01d;
  color: #222;
}
.building-color-status {
  margin-top: 6px;
  max-width: 230px;
  padding: 5px 8px;
  border-radius: 8px;
  background: white;
  font-size: 11px;
  line-height: 1.4;
}
.building-color-status:empty {
  display: none;
}
.pet-filter-toggle {
  top: 120px;
}
.pet-filter-panel {
  top: 170px;
  max-height: calc(100% - 190px);
}
.policy-place-label svg {
  width: 30px;
  height: 38px;
  fill: var(--policy-color);
  flex-shrink: 0;
}
.place-results {
  top: 170px;
}
@media (max-width: 600px) {
  .pet-species-control {
    right: 10px;
  }
  .pet-filter-toggle {
    left: 10px;
  }
  .pet-species-buttons button {
    padding: 8px;
  }
  .place-results {
    top: auto;
  }
}

.pet-filter-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pet-species-control .pet-filter-toggle {
  position: static;
  display: block;
  margin: 8px 0 0 auto;
}
.pet-filter-panel {
  left: auto;
  right: 15px;
  top: 205px;
  max-height: calc(100% - 225px);
}
@media (max-width: 600px) {
  .pet-filter-panel {
    left: auto;
    right: 10px;
  }
}

.policy-place-label.is-selected {
  outline: none;
  box-shadow: 0 3px 12px #0004;
}
.place-results.is-collapsed {
  width: auto;
  height: auto;
  bottom: auto;
  max-height: none;
  overflow: visible;
}
.place-results.is-collapsed .place-results-header {
  padding: 6px;
  border: 0;
  border-radius: 12px;
}
.place-results.is-collapsed h2,
.place-results.is-collapsed #placeList,
.place-results.is-collapsed #placeResultsBasis {
  display: none;
}
#placeResultsBasis {
  margin: 0;
  padding: 10px 15px;
  font-size: 12px;
  line-height: 1.5;
  color: #666;
  border-bottom: 1px solid #eee;
}

.pet-species-control > .pet-filter-panel {
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: 300px;
  max-width: calc(100vw - 30px);
  max-height: min(55vh, calc(100vh - 330px));
}
.policy-place-label.icon-only {
  padding: 3px;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
.policy-place-label.icon-only span {
  display: none;
}
.policy-place-label.icon-only svg {
  width: 30px;
  height: 38px;
}

.policy-place-label.icon-only {
  position: relative;
  overflow: visible;
  line-height: 0;
}
.policy-place-label.icon-only svg {
  display: block;
}
.policy-place-label.icon-only .pin-hover-name {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translateX(-50%);
  max-width: 240px;
  padding: 8px 10px;
  border: 1px solid #cce1d6;
  border-radius: 8px;
  background: #fff;
  color: #173e31;
  box-shadow: 0 2px 10px #0002;
  font: 600 13px/1.4 var(--font-family, sans-serif);
  white-space: nowrap;
  pointer-events: none;
}
.policy-place-label.icon-only:is(:hover, :focus-visible, .is-hovered)
  .pin-hover-name {
  display: block;
}
.policy-place-label:focus-visible {
  outline: 2px solid #185f43;
  outline-offset: 3px;
}

.policy-place-label.icon-only {
  width: 30px !important;
  height: 38px !important;
  min-width: 30px !important;
  min-height: 38px !important;
  max-width: 30px !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box;
  transform: none !important;
  align-items: flex-start;
  justify-content: center;
}
.policy-place-label.icon-only > svg {
  width: 30px !important;
  height: 38px !important;
  flex: 0 0 30px;
}
