.lk-water .lk-waterline-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(6px, 1vw, 16px);
  flex-wrap: wrap;
  margin-bottom: clamp(16px, 2.8vw, 30px);
}

.lk-water [data-mermaid-toggle] {
  padding: 7px 12px;
  min-height: 40px;
  border: 1px solid currentColor;
  border-radius: 24px;
  background: transparent;
  color: var(--ink);
  font: 600 14px/1.2 Arial, sans-serif;
  cursor: pointer;
}

.lk-water [data-mermaid-toggle][hidden] { display: none; }

/* Sprites have transparent margins. Size their painted silhouettes against the
   photograph itself, including when the gallery switches to a single column. */
.lk-water :is(.lk-illustrated-water, .lk-mask) {
  container-type: inline-size;
  --sprite: min(28cqw, 160px);
}

.lk-water .lk-vignette {
  position: absolute;
  right: 1%;
  bottom: 2%;
  width: var(--sprite);
  display: block;
  pointer-events: none;
}

.lk-water #cafe .lk-vignette { right: auto; left: 1%; }

.lk-water .lk-illustrated-water {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.lk-water .lk-swim {
  --lap: 19s;
  position: absolute;
  inset-inline: 3%;
  bottom: 3%;
  height: calc(var(--sprite) * .8125);
  pointer-events: none;
}

.lk-water .lk-panorama-water .lk-swim {
  --sprite: min(21cqw, 174px);
  --lap: 24s;
  inset-inline: 15% 6%;
  bottom: 7%;
}

/* The open water to the right stays clear of the kayak paddle throughout the lap. */
.lk-water #kayaks .lk-swim { inset-inline: 50% 1%; bottom: 1%; }
.lk-water #sap .lk-vignette { right: 2%; bottom: 4%; }
.lk-water #sap .lk-vignette img {
  mask-image: linear-gradient(#000 0 67%, #000b 81%, transparent 97%);
}
.lk-water #sap .lk-vignette::after {
  content: "";
  position: absolute;
  width: 37%;
  height: 3%;
  left: 36%;
  top: 78%;
  border-bottom: 1px solid #e9f5cc88;
  border-radius: 50%;
}
.lk-water :is(#kayaks, #panorama, #freediving) .lk-swim img {
  filter: saturate(.88);
}
.lk-water #freediving .lk-swim { --lap: 22s; }

.lk-water .lk-swim-track {
  display: block;
  position: relative;
  width: calc(100% - var(--sprite));
  height: 100%;
}

.lk-water .lk-vignette img,
.lk-water .lk-swim img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 160 / 130;
  object-fit: contain;
  background: transparent;
}

.lk-water .lk-swim img {
  width: var(--sprite);
  max-width: none;
}

.lk-water .lk-swim.is-swimming .lk-swim-track { animation: lk-swim-lap var(--lap) ease-in-out infinite both; }
.lk-water .lk-swim.is-swimming img {
  animation: lk-swim-dip var(--lap) ease-in-out infinite;
}

/* A few bubbles mark the dip. Only one painted figure exists at any instant. */
.lk-water .lk-swim.is-swimming .lk-swim-track::after {
  content: "";
  position: absolute;
  top: 40%;
  left: calc(var(--sprite) * .44);
  width: 19px;
  height: 23px;
  background:
    radial-gradient(circle at 22% 65%, transparent 1px, #e3f3deba 1.5px, transparent 2.5px),
    radial-gradient(circle at 71% 38%, transparent 2px, #deeee2b5 2.5px, transparent 3.5px),
    radial-gradient(circle at 42% 9%, #edf8dc9e 1px, transparent 2px);
  animation: lk-turn-bubbles var(--lap) ease-out infinite;
}
@keyframes lk-swim-lap {
  0%, 2%, 95%, 100% { transform: translate(0, 0); }
  25% { transform: translate(50%, -9%); }
  47%, 51% { transform: translate(100%, -3%); }
  74% { transform: translate(50%, 5%); }
}
@keyframes lk-swim-dip {
  0%, 47%, 98%, 100% { opacity: 1; transform: scaleX(1); }
  49%, 96.01% { opacity: 0; transform: translateY(8%) rotate(-6deg) scaleX(1); }
  49.01%, 96% { opacity: 0; transform: translateY(8%) rotate(6deg) scaleX(-1); }
  51%, 94% { opacity: 1; transform: scaleX(-1); }
}
@keyframes lk-turn-bubbles {
  0%, 47%, 94%, 100% { opacity: 0; transform: translateY(4px); }
  49%, 96% { opacity: .85; }
  51%, 98% { opacity: 0; transform: translateY(-6px); }
}

/* The portal typography also colors headings inside the dark underwater panel. */
.lk-page.lk-water .entry-content.city-content .lk-sceneheading h2 { color: #fff !important; }
.lk-page.lk-water .entry-content.city-content .lk-sceneheading > p { color: #bfea6b !important; }
