/* Floating map access & sheet styles */

:root {
  --fs-map-fab-size: 54px;
  --fs-map-fab-gap: 18px;
}

.fs-map-fab {
  position: fixed;
  right: 16px;
  bottom: calc(20px + 2 * (60px + var(--fs-map-fab-gap)));
  width: var(--fs-map-fab-size);
  height: var(--fs-map-fab-size);
  border-radius: 9999px;
  border: none;
  background: linear-gradient(135deg, #1a6b3c, #2c9e5f);
  color: #fff;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1060;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.fs-map-fab:focus-visible {
  outline: 3px solid rgba(16, 185, 129, 0.75);
  outline-offset: 2px;
}

.fs-map-fab:active {
  transform: translateY(1px) scale(0.98);
}

.fs-map-fab__icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.fs-map-fab__tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
}

.fs-map-fab:hover .fs-map-fab__tooltip,
.fs-map-fab:focus-visible .fs-map-fab__tooltip {
  opacity: 1;
}

/* Stack refresh/search/map buttons so they never overlap */
.floating-refresh-container {
  bottom: 20px !important;
  right: 16px !important;
}

#fs-search-fab {
  bottom: calc(20px + 60px + var(--fs-map-fab-gap));
  right: 16px;
  z-index: 1055;
}

.fs-nudge {
  bottom: calc(20px + 3 * (60px + var(--fs-map-fab-gap)));
  right: 16px;
}

/* Map sheet styling */
.fs-map-sheet {
  border: none;
  padding: 0;
  width: min(100vw, 960px);
  height: min(90dvh, 760px);
  max-height: 90dvh;
  margin: 0;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  background: transparent;
  position: fixed;
  inset: auto 50% 0;
  transform: translateX(-50%);
  box-shadow: 0 -24px 70px rgba(15, 23, 42, 0.28);
  z-index: 1065;
}

.fs-map-sheet:not([open]) {
  display: none;
}

.fs-map-sheet::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

.fs-map-sheet__panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #ffffff;
}

.fs-map-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, #1a6b3c, #2c9e5f);
  color: #fff;
  min-height: 56px;
}

.fs-map-sheet__title {
  font-size: 16px;
  font-weight: 700;
}

.fs-map-sheet__close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.fs-map-sheet__close:hover,
.fs-map-sheet__close:focus-visible {
  transform: scale(1.05);
}

.fs-map-sheet__close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

.fs-map-sheet__frame {
  flex: 1 1 auto;
  border: none;
  width: 100%;
  background: #f8fafc;
}

.fs-map-sheet--open {
  display: block;
}

.fs-map-locked {
  overflow: hidden !important;
  touch-action: none;
}

.fs-map-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 1064;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.fs-map-backdrop--open {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 1024px) {
  .fs-map-sheet {
    border-radius: 16px;
    top: 8vh;
    bottom: auto;
    height: min(84dvh, 820px);
  }
}

@media (max-width: 640px) {
  :root {
    --fs-map-fab-size: 52px;
    --fs-map-fab-gap: 16px;
  }

  .fs-map-fab {
    right: 12px;
    bottom: calc(16px + 2 * (60px + var(--fs-map-fab-gap)));
  }

  .fs-map-fab__tooltip {
    display: none;
  }

  #fs-search-fab {
    right: 12px;
    bottom: calc(16px + 56px + var(--fs-map-fab-gap));
  }

  .floating-refresh-container {
    right: 12px !important;
    bottom: 16px !important;
  }

  .fs-nudge {
    right: 12px;
    bottom: calc(16px + 2 * (56px + var(--fs-map-fab-gap)) + 12px);
  }

  .fs-map-sheet {
    width: 100vw;
    transform: none;
    left: 0;
    right: 0;
  }
}

.map-error {
  padding: 24px;
  background: #fee2e2;
  color: #991b1b;
  border-radius: 14px;
  border: 1px solid #fecaca;
  font-weight: 600;
  text-align: center;
  margin: 18px;
}