/* Universal gallery engine - styles for the index grid, trip map and root gallery list. */
* {
  box-sizing: border-box;
}

html {
  scroll-snap-type: y proximity;
}

body {
  margin: 0;
  background-color: #000000;
  color: #ffffff;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Open Sans",
    "Helvetica Neue",
    sans-serif;
}

img {
  max-width: 100%;
}

header.gal-header {
  gap: 32px;
  max-width: 1400px;
  margin: 32px auto;
  padding: 0 32px;

  a {
    color: #ffffff;
  }
}

h1 {
  font-family: "Rajdhani", sans-serif;
  line-height: 1.15;
  text-shadow: 0 0 15px rgba(0, 0, 0, 0.25);
  margin: 0;
  margin-top: env(safe-area-inset-top);
  position: relative;
  display: inline-block;
  &::after {
    content: "";
    position: absolute;
    left: -50px;
    bottom: -14px;
    width: 300px;
    height: 22px;
    background-repeat: no-repeat;
    background-size: contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 22'%3E%3Cpath d='M4,10 C60,1 110,3 150,8 C180,12 210,14 240,9 C260,6 280,10 296,7' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    mask-image: linear-gradient(
      to right,
      transparent 0%,
      black 25%,
      black 65%,
      transparent 100%
    );
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0%,
      black 25%,
      black 65%,
      transparent 100%
    );
  }
}

.gal-sub {
  font-family: "Cormorant", serif;
  font-size: 22px;
  line-height: 1.25;
  margin: 16px 0;
  a {
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-skip-ink: all;
    transition: text-underline-offset 0.2s ease-in-out;
    -webkit-tap-highlight-color: transparent;
    &:hover {
      text-underline-offset: 2px;
    }
  }
}

/* ============ gallery index ============ */

/* visually hidden text — icon links keep their label in the DOM for screen
   readers; the visible icon is an inline SVG next to it (gal_svg in lib.php) */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* page fullscreen toggle — same placement/look as the coverflow toolbar
   icon (25 px, top-right, expand/collapse SVGs, faded until hovered);
   fixed so it stays reachable while the page scrolls. Both state icons are
   inline in the markup, the collapsed/expanded class picks the visible one */
.page-fs {
  position: fixed;
  top: 25px;
  right: 25px;
  z-index: 2100;
  width: 25px;
  height: 25px;
  overflow: hidden;
  /* it is a <button> (was an <a>) — strip the UA button chrome */
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  /* icon color — the inline SVGs fill with currentColor (explicit: a bare
     <a> would resolve currentColor to the UA link blue/visited purple) */
  color: var(--color-text, #fff);
  opacity: 0.35;
  transition: opacity 0.3s;
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

.page-fs:hover,
.page-fs:focus-visible {
  opacity: 1;
}

.page-fs svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.page-fs.collapsed .ic-collapse {
  display: none;
}
.page-fs.expanded .ic-expand {
  display: none;
}

@supports (padding: max(0px)) {
  .page-fs {
    right: max(25px, env(safe-area-inset-right));
  }
}

/* photo viewer overlay — the coverflow detail loaded in an iframe over the
   living index document, so opening/closing a photo never drops the page
   fullscreen state; the URL is maintained via the History API (index.js) */
.gal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  background: #000;
}

.gal-overlay.open {
  display: block;
}

.gal-overlay iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 32px;
  max-width: 1400px;
  margin: 32px auto;
  padding: 0 32px;
}

.card-thumb {
  position: relative; /* anchors the video play badge */
  display: flex;
  flex-direction: row;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

@keyframes liquid {
  0% {
    border-radius: 60% 40% 30% 70%/60% 30% 70% 40%;
  }
  50% {
    border-radius: 30% 60% 70% 40%/50% 60% 30% 60%;
  }
  100% {
    border-radius: 60% 40% 30% 70%/60% 30% 70% 40%;
  }
}

.card-thumb {
  img {
    display: block;
    width: 100%;
    height: 150px;

    width: 175px;
    height: 175px;

    object-fit: cover;
    /* --focal-* set inline from focal.json (tpl-index); absent = center crop */
    object-position: var(--focal-x, 50%) var(--focal-y, 50%);
    transition: border-radius 1.5s ease-in-out;
    border-radius: var(--blob, 12px);
  }

  &.is-hovered img {
    border-radius: 60% 40% 30% 70%/60% 30% 70% 40%;
    animation: liquid 7s ease-in-out infinite;
    animation-delay: 1.5s;
  }
}
/* play badge marking video items in the grid */
.card-play {
  position: absolute;
  left: 75%;
  top: 75%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.85),
    0 2px 6px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.card-play::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 12px;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent #fff;
}
.card-title {
  margin: 10px 0 6px;
  font-size: 16px;
  line-height: 1.25;
  text-align: center;
}
.card-title a {
  text-decoration: none;
  color: #ffffff;
}
.card-title a:hover {
  text-decoration: underline;
}
.card-meta {
  margin: 2px 0;
  font-size: 12.5px;
  opacity: 0.65;
  text-align: center;
}

/* ============ accompanying HTML snippets (video players, narrative, etc.) ============ */

.accompanying-html {
  max-width: 1400px;
  margin: 48px auto 32px;
  padding: 0 32px;
}

.trip-section {
  gap: 32px;
  max-width: 1400px;
  margin: 32px auto;
  padding: 0 32px;
  scroll-snap-align: end;
}

.trip-title,
.accompanying-html h2 {
  font-size: 22px;
  margin: 0 0 32px 0;
}

.gal-footer {
  height: 30px;
}

/* ============ map ============ */

.map-wrap {
  position: relative;
  height: 78vh;
  min-height: 520px;
  overflow: hidden;
}
.map-wrap:fullscreen {
  border-radius: 0;
}
#map,
.cesium-host {
  position: absolute;
  inset: 0;
}
/* explicit size: maplibre-gl.css (loaded later) turns its container into
   position:relative, which would collapse an inset-sized box to 0 height */
.cesium-host {
  z-index: 500;
  width: 100%;
  height: 100%;
}

.map-tabs,
.ml3d-tabs {
  --r: 8px;
  --overlap: calc(2 * var(--r));
  --bar: #fff;
  --text: #333;
  --hover: #333;
  --active-bg: #333;
  --active-text: #fff;
  --focus-visible: #ffbf00;

  display: flex;
  flex-wrap: wrap;
  row-gap: 8px;
  padding-left: var(--overlap);
  position: absolute;
  top: 10px;
  left: 56px;
  z-index: 1200;

  button {
    font-size: 11px;
    position: relative;
    max-width: fit-content;
    margin-left: calc(-1 * var(--overlap));
    padding: 0;
    border: 0;
    border-radius: var(--r);
    background: var(--bar);
    color: var(--text);
    cursor: pointer;

    span {
      position: relative;
      z-index: 1;
      display: block;
      margin: 8px calc(var(--r) + 3px);
      padding: 4px var(--r);
      border-radius: calc(var(--r) - 3px);
      background: transparent;
      transition:
        background-color 0.15s ease,
        color 0.15s ease;
    }

    &:hover span {
      background: var(--hover);
      color: var(--active-text);
    }

    &:active span,
    &.active span,
    &[aria-pressed="true"] span {
      background: var(--active-bg);
      color: var(--active-text);
    }

    &:focus-visible {
      outline: none;

      span {
        outline: 2px solid var(--focus-visible);
        outline-offset: 2px;
      }
    }
  }
}

#mapyOpen {
  display: none;
}

.map-btns {
  position: absolute;
  top: 84px;
  left: 10px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-btns button,
.map-btns .map-btn-link {
  width: 34px;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font:
    bold 12px "Trebuchet MS",
    Verdana,
    sans-serif;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #333;
  cursor: pointer;
  text-decoration: none;
  padding: 2px;
}

.map-btns .map-btn-link {
  width: auto;
  font-size: 10px;
  padding: 2px 5px;
}

.map-btns button:hover,
.map-btns .map-btn-link:hover {
  background: #f4f4f4;
}

#mapyLogo {
  position: absolute;
  bottom: 6px;
  left: 6px;
  z-index: 1200;
}
#mapyLogo img {
  display: block;
}

.map-side {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: 238px;
  /*to be over fullscreen button on mobile */
  z-index: 2200;
  background: #fff;
  color: #222;
  padding: 8px 10px;
  overflow-y: auto;
  font-size: 13px;
  border-radius: 12px;
}
/* an <h3> (zoom list) / fieldset <legend> (overlays) for structure —
   UA defaults reset so it looks exactly like the old plain div */
.side-title {
  font-size: inherit;
  font-weight: bold;
  margin: 0 0 4px;
  padding: 0;
}
.side-close {
  display: none;
}
.side-toggle {
  display: none;
}
.side-overlays {
  /* a <fieldset> — reset its UA border/padding, keep the old div look */
  margin: 0 0 10px;
  border: 0;
  padding: 0;
  min-width: 0;
}
.side-overlays label {
  display: block;
  margin: 2px 0;
  cursor: pointer;
}
.side-overlays input {
  vertical-align: -2px;
  margin-right: 4px;
}
.side-tracks {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;

  @media (max-width: 1000px) and (orientation: landscape) {
    max-height: calc(100dvh - 190px);
    overflow-y: auto;
    overflow-x: hidden;
  }

  @media (max-width: 1000px) and (orientation: portrait) {
    max-height: calc(100dvh - 450px);
    overflow-y: auto;
    overflow-x: hidden;
  }
}
.side-tracks li {
  margin: 3px 0;
}
/* zoom entries are <button>s (they act on the map; links had no Space key)
   styled to keep the old link look */
.side-tracks button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  text-align: left;
  color: #06c;
  text-decoration: underline;
  cursor: pointer;
}
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  color: #fff;
  font:
    bold 11px Verdana,
    sans-serif;
  vertical-align: -3px;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}
.chip-sum {
  background: #555;
}
.chip-cam {
  background: #000;
  font-size: 10px;
}
.side-jump label {
  display: block;
  font-weight: bold;
  margin-bottom: 3px;
}

/* pseudo-select with photo thumbnails as options */
.psel {
  position: relative;
}
.psel-btn {
  width: 100%;
  text-align: left;
  font:
    12.5px "Trebuchet MS",
    Verdana,
    sans-serif;
  padding: 4px 24px 4px 7px;
  border: 1px solid #888;
  border-radius: 3px;
  background: #fff;
  color: #222;
  cursor: pointer;
  position: relative;
}
.psel-btn::after {
  content: "\25BE";
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  color: #555;
}
/* .psel-panel = the positioned box + chrome; .psel-list = the scrolling
   listbox inside it. Splitting the two lets the mobile close cross stay
   pinned in the panel's corner while the options scroll under it. */
.psel-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  background: #fff;
  border: 1px solid #888;
  border-top: 0;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.35);
}
.psel-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 5px;
}
.psel-opt {
  position: relative;
  margin: 5px 0;
  cursor: pointer;
  border: 1px solid #888;
}
.psel-opt:first-child {
  margin-top: 0;
}
.psel-opt:hover,
.psel-opt.kb-active {
  outline: 2px solid #333;
}
.psel-opt img {
  display: block;
  width: 100%;
  height: 75px;
  object-fit: cover;
  object-position: var(--focal-x, 50%) var(--focal-y, 50%);
}
.psel-opt .lbl {
  position: absolute;
  left: 0;
  bottom: 0;
  background: #000;
  color: #fff;
  padding: 1px 5px;
  font-size: 11px;
}
.psel-opt .dt {
  position: absolute;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  padding: 1px 5px;
  font-size: 11px;
}
.psel-list-close {
  display: none;
}
.psel-title {
  /* mobile-only duplicate of the photoJumpLabel — the ≤1000px flip-up panel
     covers the sidebar (incl. the real label), so it carries its own title;
     desktop keeps the label above the trigger and hides this one */
  display: none;
}

.elev-panel {
  --elev-stats-opacity: 1;
  --elev-opacity: 1;
  position: absolute;
  right: 260px;
  bottom: 10px;
  z-index: 1200;
  background: #fff;
  color: #222;
  border-radius: 12px;
  padding: 8px;
  width: 498px;
  max-width: calc(100% - 280px);
  text-align: center;
}
.elev-stats {
  --elev-stats-opacity: 1;
  --elev-opacity: 1;
  opacity: var(--elev-stats-opacity, var(--elev-opacity, 1));
  transition: opacity 0.5s ease;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px;
  margin-bottom: 6px;
  font-size: 13px;
  color: #000;
  border-radius: 8px;
  line-height: 1.4;
}
.elev-stats span {
  white-space: nowrap;
}
.elev-stats span:not(:first-child) {
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  padding-left: 10px;
}
.elev-stats small {
  opacity: 0.75;
}
.elev-panel canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: pan-y;
}
.elev-info {
  font-size: 12.5px;
  margin-top: 4px;
  min-height: 32px;
}

/* notice shown over the map instead of alert() */
.map-note {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  max-width: 92%;
  max-width: min(420px, 92%);
  background: rgba(20, 20, 22, 0.93);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  padding: 10px 34px 10px 14px;
  border-radius: 6px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
}
.map-note-close {
  position: absolute;
  top: 4px;
  right: 6px;
  border: 0;
  background: none;
  color: #ccc;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.map-note-close:hover {
  color: #fff;
}

/* marker popup */
.pp {
  font-size: 12px;
  color: #222;
}
.pp-t {
  font-weight: bold;
  font-size: 13px;
}
.pp-nav {
  margin: 2px 0;
}
.pp-nav a {
  color: #06c;
}
/* popup prev/next are <button>s — same look as the links they replaced */
.pp-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: #06c;
  text-decoration: underline;
  cursor: pointer;
}
.pp-dis {
  color: #999;
}
.pp img {
  display: block;
  width: 100%;
  height: 125px;
  object-fit: cover;
  object-position: var(--focal-x, 50%) var(--focal-y, 50%);
  margin: 6px 0;
  border: 1px solid #888;
}
.pp-title {
  font-style: italic;
  margin-bottom: 3px;
}

/* maplibre 3D photo popup (all-bubbles mode) — content reuses .pp */
.maplibregl-popup-content {
  padding: 10px 12px;
}
.maplibregl-popup-close-button {
  font-size: 18px;
  padding: 0 6px;
}

.cesium-bubble {
  position: absolute;
  top: 56px;
  left: 56px;
  z-index: 1300;
  width: 270px;
  background: #fff;
  border: 1px solid #666;
  border-radius: 6px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
  padding: 10px 12px;
}
.pp-close {
  float: right;
  border: 0;
  background: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #444;
}

/* keyboard focus — amber over the dark map chrome… */
.map-btns button:focus-visible,
.psel-btn:focus-visible,
.side-toggle:focus-visible {
  outline: 2px solid #ffbf00;
  outline-offset: 2px;
}
/* …blue on the white sidebar/popup/graph surfaces (amber would wash out) */
.side-tracks button:focus-visible,
.side-close:focus-visible,
.psel-list-close:focus-visible,
.pp-btn:focus-visible,
.pp-close:focus-visible,
#elevCanvas:focus-visible {
  outline: 2px solid #06c;
  outline-offset: 1px;
}

/* ============ root gallery list ============ */

.root-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
  max-width: 1400px;
  margin: 32px auto;
  padding: 0 32px;
}

/* ============ responsive ============ */

@media (max-width: 1000px) {
  .map-tabs {
    flex-wrap: wrap;
  }

  /* Below this width the "Skok na fotografii" trigger ends up near the bottom
     of a short side panel — portrait pins it to the bottom of the sheet,
     landscape to the bottom of a viewport-tall panel — so its dropdown has no
     room to open downward. It grows UPWARD over the panel instead: dropping
     .psel to position:static makes .map-side (not .psel) the containing
     block, so the flip panel can size itself against .map-side's own box,
     whatever height it currently has. */
  .map-side .psel {
    position: static;
  }
  .map-side.psel-open {
    overflow: hidden;
  } /* see openList() — the sidebar is parked while covered */
  .map-side .psel-panel {
    /* Anchored at the BOTTOM and animated on height, never on transform: a
       transformed box still contributes to .map-side's scrollable overflow,
       which left dead scrollable space under the trigger while closed.
       Growing from height 0 upward stays inside the container at every
       frame. The bottom offset clears .psel-btn (25 px tall + .map-side's
       14 px bottom padding) so the trigger stays visible for context. */
    position: absolute;
    top: auto;
    left: 0;
    right: 0;
    bottom: 40px;
    height: calc(100% - 40px);
    z-index: 30;
    border: 0;
    border-top: 1px solid #999;
    border-bottom: 10px solid #fff;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.45);
    overflow: hidden; /* clips the options while the panel is still growing */
    transition:
      height 0.22s ease,
      visibility 0s linear 0.22s;
  }
  .map-side .psel-panel[hidden] {
    display: block; /* stays laid out so the open can animate — an author display beats the UA [hidden]{display:none} regardless of specificity */
    height: 0;
    border-top-width: 0; /* border-box floors the height at the border width — zero it so the parked box is truly 0 */
    visibility: hidden;
  }
  .map-side .psel-panel:not([hidden]) {
    visibility: visible;
    transition: height 0.22s ease;
  }
  /* only this scrolls — the close cross above it is a sibling, so it stays
     put in the panel's corner; the top padding keeps the first option from
     starting underneath it */
  .map-side .psel-list {
    height: 100%;
    max-height: none;
    overflow-y: auto;
    padding: 40px 10px 10px;
    overscroll-behavior: contain;

    &:before {
      content: "";
      background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 1) 25px,
        rgba(255, 255, 255, 0.5) 30px,
        rgba(255, 255, 255, 0) 50px
      );
      width: 100%;
      height: 50px;
      top: 0;
      left: 0;
      z-index: 1;
      position: absolute;
      pointer-events: none;
    }

    &:after {
      content: "";
      background: linear-gradient(
        0deg,
        rgba(255, 255, 255, 1) 0px,
        rgba(255, 255, 255, 0) 25px
      );
      width: 100%;
      height: 25px;
      bottom: 0;
      left: 0;
      z-index: 1;
      position: absolute;
      pointer-events: none;
    }
  }
  .map-side .psel-list-close {
    display: block;
    position: absolute;
    top: 4px;
    right: 8px;
    z-index: 2; /* over the scrolling listbox, inside the panel */
    border: 0;
    background: none;
    font-size: 22px;
    line-height: 1;
    color: #444;
    cursor: pointer;
    padding: 4px 8px;
    text-align: right;
  }
  /* the panel's own title — takes over for the covered photoJumpLabel;
     pinned in the top strip next to the close cross, over the listbox's
     white top fade */
  .map-side .psel-title {
    display: block;
    position: absolute;
    top: 11px;
    left: 14px;
    right: 44px; /* keeps clear of the close cross */
    z-index: 2;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Landscape phones/short windows keep the DESKTOP layout: the map box is
   already shorter than the sheet would need, and a sheet rising from the
   bottom would bury it. Only the elevation graph shrinks — at the desktop
   width it would eat most of a ~400 px-tall viewport. The canvas is
   width:100% over a fixed 480x200 attribute ratio, so a narrower panel
   scales its height down with it. */
@media (max-width: 1000px) and (orientation: landscape) {
  /* the 520 px floor is taller than the screen here, which would crop the
     side panel at both ends — fit the map box to the viewport instead */
  .map-wrap {
    height: 100dvh;
    min-height: 0;
  }
  /* bottom-LEFT corner here: the desktop right:254px anchor tucks it against
     the side panel, which is the cramped side of a short landscape map */
  .elev-panel {
    left: 10px;
    right: auto;
    width: 330px;
    padding: 6px;
  }
  .elev-info {
    font-size: 11.5px;
    min-height: 26px;
    margin-top: 3px;
  }

  .trip-section,
  .accompanying-html {
    margin: 0;
    padding: 0;
  }

  .trip-title,
  .accompanying-html h2 {
    padding: 32px;
    margin: 0 0 10px 0;
  }

  .gal-footer {
    height: 0;
  }
}

@media (max-width: 1000px) and (orientation: portrait) {
  .trip-section,
  .accompanying-html {
    margin: 0;
    padding: 0;
  }

  .trip-title,
  .accompanying-html h2 {
    padding: 32px;
    margin: 0 0 10px 0;
  }

  .gal-footer {
    height: 0;
  }

  .map-wrap {
    overflow: visible;
    height: calc(100dvh - 94px);
    min-height: unset;
  }

  .elev-panel {
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
  }

  /* sidebar becomes a bottom sheet, opened by the floating button */
  .map-side {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: 0;
    max-height: calc(100dvh - 275px);
    border: 0;
    border-top: 1px solid #999;
    border-radius: 12px 12px 0 0;
    padding: 0;
    transform: translateY(102%);
    transition: transform 0.25s ease;
    z-index: 1400;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.45);
  }
  .map-wrap.side-open .map-side {
    transform: translateY(0);
    padding: 12px 14px 14px;
    height: auto;
  }
  .side-close {
    display: block;
    position: absolute;
    top: 4px;
    right: 8px;
    border: 0;
    background: none;
    font-size: 22px;
    line-height: 1;
    color: #444;
    cursor: pointer;
    padding: 4px 8px;
  }
  .side-toggle {
    display: block;
    position: absolute;
    top: -72px;
    right: 20px;
    z-index: 2300;
    font:
      bold 12px "Trebuchet MS",
      Verdana,
      sans-serif;
    padding: 7px 12px;
    border: 1px solid #777;
    border-radius: 16px;
    background: #fff;
    color: #333;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  }
}

/* Input-modality dismissal of the keyboard focus indicator: common.js flags
   any mouse/touch activity with html.pointer-mode (the next keydown clears
   it) and this rule hides every focus outline while it is set — focus
   itself is NOT blurred, so Tab resumes from the same element. !important:
   deliberately outranks every focus rule (incl. the #elevCanvas one)
   regardless of specificity. */
html.pointer-mode :focus-visible {
  outline: none !important;
}
