/* Map page: harbor view, chips on the map, round controls */
.app-karta {
  height: 100dvh;
  overflow: hidden;
}

.lager-rad {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 58px;
  z-index: 12;
  pointer-events: none;
}

.lager-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lager-mer-chips {
  margin-top: 6px;
}
.lager-mer-chips[hidden] {
  display: none !important;
}

.lager-rad button {
  pointer-events: auto;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(245, 240, 232, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #1C2B3A;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(28, 43, 58, 0.12), 0 1px 2px rgba(28,43,58,0.08);
}

.lager-rad button.is-on {
  background: #0A7A8C;
  border-color: #0A7A8C;
  color: #fff;
  box-shadow: 0 2px 10px rgba(10, 122, 140, 0.32);
}

.lager-rad .lager-mer {
  position: relative;
  padding-right: 14px;
}

.lager-rad .lager-mer.has-on::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #0A7A8C;
}

.lager-rad .lager-mer.is-open {
  border-color: #1C2B3A;
}

.map-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
}

#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: #eceae4;
  z-index: 0;
}

.maplibregl-ctrl-attrib,
.maplibregl-ctrl-logo,
.maplibregl-compact {
  display: none !important;
}
.basemap-color {
  filter: saturate(0.75) brightness(1.04) contrast(0.92);
}

.leaflet-marker-icon,
.leaflet-marker-shadow,
.karta-pin-wrap,
.karta-cluster-wrap {
  background: none !important;
  border: 0 !important;
  overflow: visible !important;
}

.karta-pin {
  position: relative;
}

.karta-pin-namn {
  position: absolute;
  left: calc(100% + 7px);
  top: 50%;
  transform: translateY(-50%);
  max-width: 160px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.96);
  color: #1C2B3A;
  font-family: Inter, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(28, 43, 58, 0.16);
  pointer-events: none;
  border: 1px solid rgba(28, 43, 58, 0.08);
}

.karta-pin-namn.is-left {
  left: auto;
  right: calc(100% + 7px);
}

.karta-cluster {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1C2B3A;
  color: #FFFCF7;
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px rgba(28, 43, 58, 0.22);
}
.karta-cluster.is-dim {
  opacity: 0.4;
}

.lista-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 14;
}

.map-ctrls {
  position: absolute;
  right: 12px;
  bottom: 18px;
  z-index: 14;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.map-wrap.sheet-open .map-ctrls {
  bottom: 258px;
}

.map-ctrl {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(245, 240, 232, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #1C2B3A;
  font-size: 18px;
  box-shadow: 0 2px 10px rgba(28, 43, 58, 0.14);
  cursor: pointer;
  padding: 0;
}
.map-ctrl i {
  font-size: 18px;
  line-height: 1;
}
.map-ctrl.is-busy {
  opacity: 0.55;
}
.lista-btn[aria-expanded="true"] {
  background: #1C2B3A;
  color: #fff;
}

.pin-lista {
  position: absolute;
  top: 56px;
  left: 8px;
  right: 8px;
  z-index: 15;
  margin: 0;
  padding: 6px 0 0;
  max-height: 42%;
  overflow: auto;
  background: #FFFCF7;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(28, 43, 58, 0.16);
}
.pin-lista[hidden] { display: none; }
.pin-lista-rader {
  margin: 0;
  padding: 0;
  list-style: none;
}
.pin-lista button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  background: none;
  text-align: left;
  font-family: Inter, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #1C2B3A;
  cursor: pointer;
}
.pin-lista button > .ph {
  flex: 0 0 auto;
  font-size: 16px;
  color: #1C2B3A;
}
.pin-lista .lista-namn {
  flex: 1 1 auto;
  min-width: 0;
}
.pin-lista .lista-meta {
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(28, 43, 58, 0.55);
}
.pin-lista li.is-shut button {
  opacity: 0.55;
}
.lista-stangda {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 4px 0 0;
  padding: 0 14px;
  border-top: 1px solid #E0D9CF;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1C2B3A;
  cursor: pointer;
}
.lista-stangda input {
  width: 18px;
  height: 18px;
  accent-color: #1C2B3A;
}

.pin-sheet {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 13;
  display: none;
  overflow: hidden;
  background: #FFFCF7;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(28, 43, 58, 0.18);
}

.pin-sheet::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(28, 43, 58, 0.15);
  z-index: 2;
}

.pin-sheet.is-on { display: block; }

.sheet-img-wrap {
  width: 100%;
  height: 130px;
  overflow: hidden;
  background: #D9D0C3;
}

.sheet-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
}

.sheet-img-wrap:has(img[hidden]) {
  display: none;
}

.sheet-body {
  padding: 14px 16px 16px;
}

.pin-sheet h2 {
  font-family: "Playfair Display", Palatino, Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 2rem 0.2rem 0;
  color: #1C2B3A;
  line-height: 1.2;
}

.pin-sheet p {
  margin: 0 0 0.3rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: rgba(28, 43, 58, 0.72);
}

.pin-sheet [data-sheet-text] {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pin-sheet .sheet-status {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 650;
  color: #1C2B3A;
}

.pin-sheet .sheet-status.is-shut {
  color: rgba(28, 43, 58, 0.5);
}

.pin-sheet .walk {
  color: rgba(28, 43, 58, 0.55);
  font-size: 0.8rem;
  margin: 0 0 0.5rem;
}

.sheet-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.pin-sheet .guide-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: #0A7A8C;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
}

.pin-sheet .maps-link {
  color: #0A7A8C;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sheet-close {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(245, 240, 232, 0.9);
  color: #1C2B3A;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.note-sheet {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 13;
  display: none;
  padding: 20px 16px 16px;
  overflow: hidden;
  background: #FFFCF7;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(28, 43, 58, 0.18);
}
.note-sheet.is-on { display: block; }
.note-sheet p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.4;
  color: #1C2B3A;
}

.leaflet-control-attribution {
  font-size: 8px;
  line-height: 1.2;
  max-width: 46%;
  background: rgba(255, 252, 247, 0.72) !important;
  margin: 0 0 6px 8px !important;
}

.karta-event-pulse {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #E8543A;
  border: 2px solid #fff;
  z-index: 2;
  pointer-events: none;
}

.karta-event-pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid #E8543A;
  animation: pulse-ring 1.8s ease-out infinite;
  opacity: 0;
}

@keyframes pulse-ring {
  0%   { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(2.0); opacity: 0; }
}

.plats-prompt {
  position: absolute;
  top: 54px;
  left: 10px;
  right: 10px;
  z-index: 13;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(245, 240, 232, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(217, 208, 195, 0.7);
  box-shadow: 0 4px 16px rgba(28, 43, 58, 0.13);
  font-family: Inter, system-ui, sans-serif;
}

.plats-prompt[hidden] { display: none; }

.plats-prompt-ico {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}

.plats-prompt-text {
  flex: 1 1 auto;
  font-size: 0.8rem;
  font-weight: 500;
  color: #1C2B3A;
  line-height: 1.3;
  min-width: 0;
}

.plats-prompt-ja {
  flex-shrink: 0;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 0;
  background: #0A7A8C;
  color: #fff;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}

.plats-prompt-nej {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 0;
  background: none;
  color: rgba(28, 43, 58, 0.45);
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
}

@media (min-width: 768px) {
  .app.app-karta {
    max-width: none;
  }

  .site {
    padding: 0.6rem 8px 0.5rem 14px;
  }

  .pin-sheet {
    left: 10px;
    top: 10px;
    bottom: 10px;
    right: auto;
    width: 300px;
    border-radius: 16px;
  }

  .pin-sheet::before {
    display: none;
  }

  .sheet-img-wrap {
    height: 160px;
  }

  .pin-sheet [data-sheet-text] {
    -webkit-line-clamp: 4;
  }

  .map-wrap.sheet-open .map-ctrls {
    bottom: 18px;
  }

  .map-wrap.sheet-open .lager-rad {
    left: 320px;
    transition: left 0.2s ease;
  }

  .pin-lista {
    top: 56px;
    left: 320px;
    right: auto;
    width: 320px;
    max-height: 60%;
    border-radius: 14px;
  }

  .map-wrap:not(.sheet-open) .pin-lista {
    left: 8px;
  }

  .map-wrap.sheet-open .lista-btn {
    right: 12px;
  }
}
