._customControl button {
  appearance: none;
  font-family: inherit;
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  width: 30px;
  height: 30px;
  box-shadow: rgb(0 0 0 / 65%) 0px 1px 5px;
  cursor: pointer;
}

._customControl button:hover {
  background-color: var(--hover-color);
  transition: background-color 0.2s ease-out;
}

/* Save-area group: input + 💾 button theme together (inline styles in
   map.html only set geometry, never colors). */
._customControl .numeric-input {
  background-color: var(--surface);
  color: var(--text-color);
}

._customControl .save-area-btn {
  border: none;
  border-left: 1px solid var(--border-color);
  background-color: var(--surface);
  color: var(--text-color);
}



/* Expandable Leaflet Street Search Control */
.leaflet-control-street-search {
  background: var(--card-background);
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
  overflow: visible;
  transition: width 0.3s ease;
  width: 34px; /* Initial width - just the icon */
}

.leaflet-control-street-search.expanded {
  width: 300px; /* Expanded width */
}

/* Toggle button (magnifying glass) */
.street-search-toggle {
  width: 34px;
  height: 34px;
  line-height: 34px;
  text-align: center;
  font-size: 16px;
  color: var(--text-color);
  text-decoration: none;
  display: block;
}

.street-search-toggle:hover {
  background-color: var(--hover-color);
}

/* Search form */
.street-search-form {
  display: flex;
  align-items: center;
  position: relative;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 34px;
}

.street-search-input {
  flex: 1;
  padding: 0 30px 0 10px;
  border: none;
  height: 100%;
  font-size: 14px;
  width: calc(100% - 40px);
  box-sizing: border-box;
  background-color: var(--card-background);
  color: var(--text-color);
}

.street-search-input:focus {
  outline: none;
}

.street-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--muted-text);
  cursor: pointer;
}

.street-search-clear:hover {
  color: var(--text-color);
}

.street-search-results {
  position: absolute;
  width: 300px; /* Match expanded width */
  max-height: 300px;
  overflow-y: auto;
  background: var(--card-background);
  color: var(--card-text-color);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
  z-index: 1001;
  top: 100%;
  left: 0;
}

.search-result-item {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
}

.search-result-item:hover {
  background-color: var(--hover-color);
}

.search-result-item .result-title {
  font-weight: bold;
}

.search-result-item .result-address {
  font-size: 12px;
  color: var(--card-text-color);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-error {
  color: var(--danger-color);
}

/* Search result marker */
.search-result-marker {
  position: relative;
}

/* Home/pick pins on the picker map. FA icon in a colored circle badge,
   same visual language as the area markers (bordered circle), instead of
   raw emoji (OS-dependent color/rendering, no way to theme it). */
.map-pin-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.map-pin-home {
  background-color: var(--primary-color);
}

.map-pin-pick {
  background-color: var(--danger-color);
}

.marker-pin {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  background: #c30b82;
  position: absolute;
  transform: rotate(-45deg);
  left: 50%;
  top: 50%;
  margin: -15px 0 0 -15px;
  animation: bounce 0.5s ease-out;
}

.marker-pin::after {
  content: '';
  width: 20px;
  height: 20px;
  margin: 5px 0 0 5px;
  background: #fff;
  position: absolute;
  border-radius: 50%;
}

@keyframes bounce {
  0% {
    transform: rotate(-45deg) translateY(-20px);
    opacity: 0;
  }
  100% {
    transform: rotate(-45deg) translateY(0);
    opacity: 1;
  }
}

/* Animation for expanding/collapsing */
@keyframes expand {
  from { width: 34px; }
  to { width: 300px; }
}

@keyframes collapse {
  from { width: 300px; }
  to { width: 34px; }
}


/* Guided tour overlay. The spotlight's big box-shadow dims the page except
   the highlighted control; bubble carries the step text + controls. */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
}

.tour-spotlight {
  position: fixed;
  z-index: 3001;
  border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  pointer-events: none;
  animation: area-select-pulse 1.5s infinite;
  transition: left 0.2s ease, top 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.tour-bubble {
  position: fixed;
  z-index: 3002;
  max-width: 300px;
  background: var(--surface);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.tour-step-num {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.tour-text {
  margin: 0 0 12px;
  line-height: 1.45;
}

.tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Tour buttons are shared .btn .btn-sm (+ btn-primary/btn-secondary) from
   styles.css. Only the skip button keeps a local look: borderless, muted,
   pushed to the left edge of the action row. Loads after styles.css, so
   these override the .btn fill at equal specificity. */
.tour-skip {
  margin-right: auto;
  border: none;
  background-color: transparent;
  color: var(--muted-text);
}
.tour-skip:hover {
  background-color: transparent;
  color: var(--text-color);
  transform: none;
}

/* Styles the label to be clearly visible with a white background and border */
.area-label {
  background-color: transparent;
  border: none;
}

.area-label div {
  /* Always dark-on-light: the circle floats over map tiles, not a surface. */
  color: #111;
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  background-color: rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  line-height: 30px;
  border: 2px solid #333;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

/* Map height: fixed on desktop, viewport-relative on phones (dvh tracks the mobile URL bar). */
#map {
  height: 700px;
}

@media (max-width: 768px) {
  #map {
    height: calc(100vh - 140px);
    height: calc(100dvh - 140px);
    min-height: 420px;
  }
}
