/* The map is the product. Lenses, types and the nearby rail sit on the canvas. */

.map-ui .cover { display: none; }

.mast-more { position: relative; }
.mast-more > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #3e3444;
  border-radius: 9px;
  color: #fff6fb;
  background: #1a1024;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.mast-more > summary::-webkit-details-marker { display: none; }
.mast-more[open] > summary { color: #1a1024; background: #ffd363; }
.mast-more .explore-destinations {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: min(280px, 78vw);
  max-height: min(70dvh, 520px);
  margin: 0;
  padding: 8px;
  overflow: auto;
  border: 1px solid #4a2c58;
  border-radius: 14px;
  background: #1a1024f5;
  box-shadow: 0 16px 40px #140818cc;
}
.mast-more .explore-destinations a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: #fff6fb;
  background: transparent;
  font: 650 14px/1.2 DM, sans-serif;
  text-decoration: none;
}
.mast-more .explore-destinations a:hover,
.mast-more .explore-destinations a:focus-visible { background: #2a1438; outline: none; }

.atlas-more { margin-top: 16px; }
.atlas-more > summary {
  min-height: 44px;
  color: #c2b0d0;
  font-weight: 700;
  cursor: pointer;
}
.atlas-more .atlas-reading { margin-top: 8px; }

.lens-caption {
  position: absolute;
  z-index: 6;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  pointer-events: none;
  font-family: Poster, Impact, sans-serif;
  font-style: italic;
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: #fff6fb;
  text-shadow: 0 10px 28px #140818;
  white-space: nowrap;
}

.lens-dock {
  position: absolute;
  z-index: 5;
  left: 14px;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: auto;
  max-width: none;
  transform: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  pointer-events: none;
}
#lens-categories { display: contents; }
.lens-dock button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--accent, #fff6fb) 70%, #1a1024);
  border-radius: 14px;
  color: var(--accent, #fff6fb);
  background: #140818e6;
  box-shadow: 0 8px 18px #14081866;
  pointer-events: auto;
}
.lens-dock button[aria-pressed="true"] {
  color: #140818;
  background: var(--accent);
}
.lens-dock .cat-art, .lens-dock .lens-mark, .lens-dock .ic { width: 18px; height: 18px; color: inherit; }
.lens-dock button + button { border-left: 0; }
.lens-dock .lens-name {
  font: 800 11px/1 BC, Impact, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lens-strip, .lens-rail {
  position: absolute;
  z-index: 5;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  pointer-events: auto;
}
.lens-strip::-webkit-scrollbar, .lens-rail::-webkit-scrollbar { display: none; }
.lens-strip {
  top: 72px;
  left: 78px;
  right: 16px;
  height: 44px;
  align-items: center;
}
.lens-rail {
  left: 14px;
  right: 16px;
  bottom: 52px;
}
.lens-chip, .lens-card, .lens-next {
  flex: none;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--accent, #fff6fb) 55%, #4a2c58);
  border-radius: 999px;
  color: #fff6fb;
  background: #140818e8;
}
.lens-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}
.lens-chip[aria-pressed="true"], .lens-card[aria-current="true"] {
  color: #140818;
  background: var(--accent, #ffd363);
}
.lens-chip .lens-mark, .lens-card .cat-art, .lens-card .lens-mark { width: 16px; height: 16px; }
.lens-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 196px;
  padding: 6px 10px 6px 6px;
  border-radius: 14px;
  text-align: left;
}
.lens-card img, .lens-card .lens-thumb {
  width: 52px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  background: #2a1438;
}
.lens-card .lens-thumb { display: grid; place-items: center; color: var(--accent); }
.lens-card b, .lens-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lens-card b { font-size: 13px; }
.lens-card small { color: #c2b0d0; font-size: 11px; }
.lens-card[aria-current="true"] small { color: #140818; }
.lens-next { padding: 0 14px; font-weight: 800; }

.detail-photo {
  display: block;
  width: 100%;
  height: 132px;
  object-fit: cover;
  margin: 0 0 8px;
  border-radius: 10px;
}
.detail-mark {
  display: grid;
  place-items: center;
  height: 64px;
  margin-bottom: 6px;
  color: var(--accent);
}
.detail-mark .cat-art { width: 36px; height: 36px; }

.pin .cat-art { width: 16px; height: 16px; }
.pin.selected {
  z-index: 5;
  border-radius: 4px;
  transform: translate(-50%, -85%) rotate(45deg) scale(1.12);
}
.pin.selected > * { transform: rotate(-45deg); }
.pin.waypoint { z-index: 4; animation: lens-pulse 1.1s ease-out 2; }
@keyframes lens-pulse {
  0% { box-shadow: 0 0 0 0 var(--accent); }
  100% { box-shadow: 0 0 0 16px transparent; }
}

#map:has(#lens-strip:not([hidden])) #collection-bar { visibility: hidden; }

@media (min-width: 721px) {
  .lens-dock .lens-name { display: none; }
  .map-tools { z-index: 6; }
}

@media (prefers-reduced-motion: reduce) {
  .pin.waypoint { animation: none; outline: 2px solid var(--accent); outline-offset: 3px; }
}

/* Floating controls share one glass: dark, translucent, a hairline edge and a soft shadow. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .map-ui #map {
    --map-glass-fill: rgba(20, 16, 32, .72);
    --map-glass-sheen: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 55%);
    --map-glass-edge: rgba(255, 255, 255, .14);
    --map-glass-depth: 0 8px 24px rgba(6, 4, 14, .32);
    --map-glass-filter: blur(14px) saturate(1.3);
  }
  .map-ui #map .options-box { --map-glass-fill: rgba(24, 18, 36, .9); }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more), (forced-colors: active) {
  .map-ui #map, .map-ui #map .options-box {
    --map-glass-fill: #26222e;
    --map-glass-sheen: none;
    --map-glass-filter: none;
    --map-glass-edge: #b8acbe;
    --map-glass-depth: none;
  }
}

/* A group of points is a light bubble: a tinted, see-through disc, a crisp ring and a bold count.
   The disc never grows past 42px, so neighbours keep their own space on the island. */
.pin.cluster {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--accent) 86%, #fff);
  background: color-mix(in srgb, var(--accent) 30%, rgba(17, 12, 30, .7));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent), 0 3px 10px rgba(6, 4, 14, .38);
  transform: translate(-50%, -50%);
}
/* The tap area stays 44px even though the disc is smaller. */
.pin.cluster::before {
  content: ""; position: absolute; border-radius: 50%;
  inset: min(0px, calc((100% - 44px) / 2));
}
.pin.cluster > :not(.qty) { display: none; }
.pin.cluster .qty {
  position: static; min-width: 0; padding: 0; border: 0; background: none; color: #fff;
  font: 800 11.5px/1 DM, sans-serif; letter-spacing: -0.2px; font-variant-numeric: lining-nums tabular-nums;
  text-shadow: 0 0 2px rgba(8, 5, 16, .95), 0 1px 3px rgba(8, 5, 16, .85);
}
.pin.cluster-m { width: 36px; height: 36px; }
.pin.cluster-m .qty { font-size: 12.5px; }
.pin.cluster-l { width: 42px; height: 42px; }
.pin.cluster-l .qty { font-size: 13px; }
.pin.cluster:hover, .pin.cluster:focus-visible {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 34%, transparent), 0 3px 10px rgba(6, 4, 14, .38);
}
.pin.cluster:hover .qty, .pin.cluster:focus-visible .qty { color: #191622; text-shadow: none; }

/* Place names read as map lettering, not as boxes. They sit under the markers and map.js keeps
   them clear of the bubbles; only the street a player picked floats above, as the active pill. */
.map-ui #map #map-labels { z-index: 1; }
.map-ui #map-labels span { font-family: DM, sans-serif; }
#map-labels-focus {
  position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none;
}
#map-labels-focus span {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap;
}
#map-labels-focus .label-road-selected {
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(100deg, #ffd28d, #ff9db4);
  box-shadow: 0 0 0 1px rgba(42, 16, 48, .35), 0 4px 12px rgba(6, 4, 14, .4);
  color: #2a1030;
  font: 700 11px/1.3 DM, sans-serif;
  letter-spacing: .01em;
}
#map-labels-focus .label-road-selected::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 5px; height: 5px;
  border-radius: 50%; transform: translateX(-50%);
  background: #ffd28d; box-shadow: 0 0 0 1.5px #2a1030;
}
.map-ui #map-labels .label-region {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(14, 10, 24, .38);
  color: #fff;
  font: 800 10.5px/1.3 DM, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-shadow: 0 0 2px #0c0816, 0 0 6px #0c0816, 0 1px 10px rgba(12, 8, 22, .9);
}
@media (min-width: 721px) {
  .map-ui #map-labels .label-region { padding: 2px 8px; font-size: 12px; }
}
.map-ui #map-labels .label-road {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(18, 14, 30, .8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  color: #f1eaf8;
  font: 600 11px/1.25 DM, sans-serif;
  letter-spacing: .01em;
}

/* Phone: the map is the stage. One slim strip, one row of controls, one row of chips, one dock. */
@media (max-width: 720px) {
  .map-ui #map {
    --dock-bottom: max(34px, env(safe-area-inset-bottom));
    --dock-height: 54px;
    --above-dock: calc(var(--dock-bottom) + var(--dock-height) + 8px);
  }

  /* Route preview and replay: a single 44px strip instead of a banner. */
  .map-ui #map-session-entry:not([hidden]) {
    height: 44px;
    gap: 8px;
    padding: 0 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    background: linear-gradient(100deg, #2c1634, #1e1329 58%, #1b1730);
    box-shadow: none;
  }
  .map-ui #map-session-entry:not([hidden]) + .workspace {
    height: calc(100dvh - var(--pwa-mast, 58px) - 44px);
  }
  @media (display-mode: standalone) {
    .map-ui #map-session-entry:not([hidden]) + .workspace {
      height: calc(100dvh - var(--pwa-mast, 58px) - 44px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }
  }
  .map-ui #map-session-entry a { min-height: 44px; gap: 8px; }
  .map-ui #map-session-entry .map-session-route-icon {
    width: 26px; height: 26px; border-radius: 8px;
    background: linear-gradient(135deg, #ffd28d, #ff9db4);
    color: #2a1030;
  }
  .map-ui #map-session-entry .map-session-route-icon .ic { width: 15px; height: 15px; }
  .map-ui #map-session-entry .map-session-plan-copy { gap: 0; }
  .map-ui #map-session-entry .map-session-plan-copy b { font-size: 13px; line-height: 16px; font-weight: 700; white-space: nowrap; }
  .map-ui #map-session-entry .map-session-plan-copy small { font-size: 11.5px; line-height: 15px; color: #d6c8de; }
  @media (min-width: 480px) {
    .map-ui #map-session-entry .map-session-plan-copy { display: flex; align-items: baseline; gap: 8px; }
  }
  .map-ui #map-session-entry #map-session-plan > .ic { width: 14px; height: 14px; color: #ffd28d; }
  .map-ui #map-session-entry [data-intro-replay] { gap: 6px; font-size: 12px; font-weight: 600; color: #eadfef; white-space: nowrap; }
  .map-ui #map-session-entry .map-session-film { width: 30px; height: 22px; border-color: rgba(255, 255, 255, .28); border-radius: 6px; }
  .map-ui #map-session-entry .map-session-film .ic { width: 10px; height: 10px; }

  /* Region and live count: one segmented pill, the region name always in full. */
  .map-ui #map .map-top {
    top: 12px; left: 12px; gap: 0; flex-wrap: nowrap;
    max-width: calc(100% - 76px);
  }
  .map-ui #map .region-select {
    flex: none; min-width: 0; min-height: 44px; gap: 7px; padding: 0 0 0 13px;
    border-right: 0; border-radius: 999px 0 0 999px;
  }
  .map-ui #map .region-select > .ic:first-child { width: 18px; height: 18px; color: #ff9db4; }
  .map-ui #map .region-select select {
    width: auto; max-width: calc(100vw - 122px); min-height: 44px; margin-block: -1px; padding: 0 26px 0 0;
    color: #fff; font-weight: 650; letter-spacing: -.01em; text-overflow: ellipsis;
  }
  .map-ui #map .region-select .ic:last-child { right: 8px; width: 14px; color: #cfc3da; }
  .map-ui #map .live-count {
    flex: 0 1 auto; min-width: 0; height: 44px; gap: 6px; padding: 0 13px 0 10px;
    border-radius: 0 999px 999px 0;
    color: #dcd2e6; font: 600 12px/1 DM, sans-serif; letter-spacing: 0;
  }
  .map-ui #map .live-count > span { flex: none; background: #78e5cc; box-shadow: 0 0 0 3px rgba(120, 229, 204, .18); }
  .map-ui #map .live-count b { overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
  #trophy-map[data-state="active"]:not([hidden]) ~ .workspace #map .live-count { border-radius: 999px; }
  .map-ui #map #cartography-shortcut {
    top: 12px; right: 12px; width: 44px; height: 44px; min-height: 44px; border-radius: 50%;
    color: #fbe9cf;
    background: var(--map-glass-sheen), var(--map-glass-fill);
    border: 1px solid var(--map-glass-edge);
    box-shadow: var(--map-glass-depth);
    -webkit-backdrop-filter: var(--map-glass-filter);
    backdrop-filter: var(--map-glass-filter);
  }
  .map-ui #map #cartography-shortcut[aria-pressed="true"] { color: #ffd28d; border-color: rgba(255, 210, 141, .6); }
  @media (max-width: 379px) {
    .map-ui #map .region-select { padding-left: 16px; }
    .map-ui #map .region-select > .ic:first-child, .map-ui #map .live-count > span { display: none; }
    .map-ui #map .live-count { padding: 0 12px 0 10px; }
  }
  /* "Todas las regiones" is wider than its Portuguese and English counterparts. */
  @media (max-width: 409px) {
    .map-ui:lang(es) #map .region-select { padding-left: 16px; }
    .map-ui:lang(es) #map .region-select > .ic:first-child { display: none; }
  }
  @media (max-width: 345px) {
    /* The total stays announced; the sheet shows it too. */
    .map-ui #map .live-count {
      position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%);
    }
    .map-ui #map .region-select { border-right: 1px solid var(--map-glass-edge); border-radius: 999px; }
  }

  /* Collections: 34px chips with a 44px touch area, bleeding off the edge to show there is more. */
  .map-ui #map #collection-bar { top: 58px; inset-inline: 0; gap: 0; height: 44px; }
  .map-ui #collection-bar #quick-collections {
    flex: 1 1 auto; gap: 6px; height: 44px; padding: 0 12px; scroll-padding-inline: 12px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--fade-start, 0px), #000 calc(100% - var(--fade-end, 0px)), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 var(--fade-start, 0px), #000 calc(100% - var(--fade-end, 0px)), transparent);
  }
  .map-ui #collection-bar:has(.collection-scroll:first-child:enabled) #quick-collections { --fade-start: 64px; }
  .map-ui #collection-bar:has(.collection-scroll:last-child:enabled) #quick-collections { --fade-end: 64px; }
  .map-ui #quick-collections :is(button, .street-picker) {
    position: relative; isolation: isolate; flex: none;
    min-height: 44px; gap: 6px; padding: 0 13px;
    border: 0; border-radius: 999px; background: none; box-shadow: none;
    color: #f4edf8; font: 600 13px/1 DM, sans-serif; letter-spacing: 0;
  }
  .map-ui #quick-collections :is(button, .street-picker)::before {
    content: ""; position: absolute; z-index: -1; inset: 5px 0;
    border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px;
    background: rgba(22, 17, 34, .9);
    box-shadow: 0 4px 12px rgba(6, 4, 14, .22);
  }
  .map-ui #quick-collections .street-picker .ic { color: #ff9db4; }
  .map-ui #quick-collections button[aria-pressed="true"] { color: #2a1030; font-weight: 700; }
  .map-ui #quick-collections button[aria-pressed="true"] .ic { color: #2a1030; }
  .map-ui #quick-collections button[aria-pressed="true"]::before {
    border-color: transparent;
    background: linear-gradient(100deg, #ffd28d, #ff9db4);
  }
  .map-ui #quick-collections button:focus-visible { outline-offset: -4px; }
  .map-ui #quick-collections .street-picker:focus-within { outline-offset: -4px; }
  .map-ui #collection-bar .collection-scroll {
    position: absolute; z-index: 5; top: 0; isolation: isolate;
    flex: none; width: 44px; height: 44px;
    border: 0; background: none; box-shadow: none; color: #fff;
  }
  .map-ui #collection-bar .collection-scroll:first-child { left: 4px; }
  .map-ui #collection-bar .collection-scroll:last-child { right: 4px; }
  .map-ui #collection-bar .collection-scroll::before {
    content: ""; position: absolute; z-index: -1; inset: 7px;
    border: 1px solid rgba(255, 255, 255, .2); border-radius: 50%;
    background: rgba(20, 16, 32, .92);
    box-shadow: 0 4px 12px rgba(6, 4, 14, .3);
  }
  .map-ui #collection-bar .collection-scroll .ic { width: 14px; height: 14px; }
  /* Still announced as unavailable, but out of sight and out of the way of the first chip. */
  .map-ui #collection-bar .collection-scroll:disabled { opacity: 0; pointer-events: none; }

  /* Zoom and tools: one slim pill of 44px buttons, tucked above the dock. */
  .map-ui #map .map-tools {
    z-index: 6; right: 12px; bottom: var(--above-dock);
    gap: 0; padding: 0; border-radius: 23px;
  }
  .map-ui #map .map-tools .tool { width: 44px; height: 44px; min-height: 44px; border-radius: 50%; }
  .map-ui #map .map-tools .tool .ic { width: 18px; height: 18px; stroke-width: 1.6; }
  .map-ui #map .map-tools .tool:disabled { opacity: .4; }
  .map-ui #map .map-tools .zoom-tools { position: relative; }
  .map-ui #map .map-tools .zoom-tools::after {
    content: ""; position: absolute; right: 12px; bottom: 0; left: 12px; height: 1px;
    background: rgba(255, 255, 255, .16);
  }
  @media (max-height: 480px) and (orientation: landscape) {
    .map-ui #map .map-tools .zoom-tools::after { content: none; }
  }
  .map-ui #map .map-footer { gap: 6px; padding: 0 8px 0 10px; background: #100c1a; border-top-color: rgba(255, 255, 255, .08); white-space: nowrap; }
  .map-ui #map .map-footer .policy-link { margin-inline: 0; }
  /* The credits shorten with an ellipsis instead of being chopped when the line runs out. */
  .map-ui #map .map-footer > span:first-child { display: block; flex: 0 1 auto; text-overflow: ellipsis; }
  .map-ui #map .map-footer .foot-dot { margin-inline: 4px; }
  @media (max-width: 379px) {
    .map-ui #map .map-footer { font-size: 9.5px; }
    .map-ui:lang(es) #map .map-footer { font-size: 9px; letter-spacing: -.01em; }
  }
  @media (max-width: 345px) {
    .map-ui #map .map-footer { gap: 4px; padding: 0 8px; font-size: 9px; letter-spacing: -.01em; }
    .map-ui #map .map-footer .foot-dot { margin-inline: 3px; }
  }
  .map-ui #map .options-box { right: 66px; bottom: var(--above-dock); }
  .map-ui #map:has(#lens-strip:not([hidden])) .map-tools { bottom: calc(var(--above-dock) + 52px); }
  .map-ui #map:has(#lens-rail:not([hidden])) .map-tools { bottom: calc(var(--above-dock) + 114px); }
  .map-ui #map .north {
    left: 18px; bottom: calc(var(--above-dock) + 6px); gap: 2px; opacity: .92;
  }
  .map-ui #map .north b { font-size: 11px; }
  .map-ui #map .north svg { width: 16px; height: 22px; }
  .map-ui #map:has(#lens-strip:not([hidden])) .north { display: none; }

  /* Dock: seven named destinations in one glass bar. Category colour lives in the icon. */
  .lens-caption { top: 16%; font-size: clamp(1.7rem, 9vw, 2.6rem); max-width: 92vw; }
  .map-ui #map .lens-dock {
    top: auto; right: 12px; bottom: var(--dock-bottom); left: 12px;
    flex-direction: row; align-items: center; gap: 0;
    height: var(--dock-height); padding: 3px;
    border: 1px solid var(--map-glass-edge); border-radius: 16px;
    background: var(--map-glass-sheen), var(--map-glass-fill);
    box-shadow: var(--map-glass-depth);
    -webkit-backdrop-filter: var(--map-glass-filter);
    backdrop-filter: var(--map-glass-filter);
    overflow: hidden;
    pointer-events: auto;
  }
  /* Each item is as wide as its name needs and never under 44px: the 20px icon carries the
     rest of that width as margin. A two-word name may take a second line before anything is cut. */
  .map-ui #map .lens-dock button {
    position: relative;
    flex: 1 1 auto; flex-direction: column; justify-content: center; gap: 3px;
    width: auto; min-width: auto; height: 46px; padding: 0 var(--dock-pad, 3px);
    border: 0; border-radius: 12px; background: none; box-shadow: none;
    color: #f1e9f6; font: 600 11px/11.5px DM, sans-serif; letter-spacing: 0; text-align: center;
    white-space: normal; overflow-wrap: normal;
  }
  .map-ui #map .lens-dock :is(.cat-art, .ic) {
    flex: none; width: 20px; height: 20px; margin-inline: calc(12px - var(--dock-pad, 3px));
  }
  .map-ui #map .lens-dock .cat-art { color: var(--accent, #fff6fb); }
  .map-ui #map .lens-dock .ic { stroke-width: 1.7; }
  .map-ui #map .lens-dock :is(.lens-name, #mobile-filters span, #mobile-search span) {
    position: static; width: auto; height: auto; max-width: none; margin: 0; overflow: visible; clip-path: none;
    color: inherit; font: inherit; letter-spacing: inherit; text-transform: none; white-space: inherit;
  }
  .map-ui #map .lens-dock button[aria-pressed="true"] {
    color: #2a1030;
    background: linear-gradient(135deg, #ffd28d, #ff9db4);
  }
  .map-ui #map .lens-dock button[aria-pressed="true"] .cat-art { color: #2a1030; }
  .map-ui #map .lens-dock button[aria-pressed="true"] .lens-name { font-weight: 700; }
  .map-ui #map .lens-dock button:focus-visible { outline-offset: -3px; }
  /* A hairline sets the two tools apart from the five categories. */
  .map-ui #map .lens-dock #mobile-filters { margin-left: 7px; }
  .map-ui #map .lens-dock #mobile-filters::before {
    content: ""; position: absolute; left: -4px; top: 11px; bottom: 11px; width: 1px;
    background: rgba(255, 255, 255, .16);
  }
  /* Spanish names run longer ("Cajas fuertes", "Actividades"): a slightly tighter set keeps one line. */
  .map-ui:lang(es) #map .lens-dock { --dock-pad: 2px; }
  .map-ui:lang(es) #map .lens-dock button { font-size: 10.5px; letter-spacing: -.01em; }
  @media (max-width: 409px) {
    /* Where "Cajas fuertes" has to take two lines, every icon moves up together to make room. */
    .map-ui:lang(es) #map .lens-dock button { justify-content: flex-start; gap: 2px; padding-top: 3px; }
  }
  @media (max-width: 379px) {
    .map-ui #map .lens-dock { --dock-pad: 1px; right: 8px; left: 8px; padding: 3px 2px; }
    .map-ui #map .lens-dock #mobile-filters { margin-left: 5px; }
    .map-ui #map .lens-dock #mobile-filters::before { left: -3px; }
  }
  @media (max-width: 345px) {
    /* 320px: the bar runs edge to edge so all seven keep a 44px target and their full name. */
    .map-ui #map .lens-dock { --dock-pad: 0px; right: 0; left: 0; padding: 3px 0; border-inline: 0; border-radius: 0; }
    .map-ui #map .lens-dock button { border-radius: 10px; font-size: 10.5px; letter-spacing: -.01em; }
    .map-ui #map .lens-dock #mobile-filters { margin-left: 0; }
    .map-ui #map .lens-dock #mobile-filters::before { content: none; }
    .map-ui:lang(es) #map .lens-dock button { font-size: 9.5px; letter-spacing: -.02em; }
  }

  /* The open lens rows bleed off both edges, like the collections above. */
  .lens-strip {
    top: auto; right: 0; left: 0; padding-inline: 12px; scroll-padding-inline: 12px;
    bottom: var(--above-dock);
  }
  .lens-rail {
    right: 0; left: 0; padding-inline: 12px; scroll-padding-inline: 12px;
    bottom: calc(var(--above-dock) + 52px);
  }
  #map:has(#lens-rail:not([hidden])) .detail { max-height: 38%; }
  /* The open lens speaks the same glass as the rest: its own colour only tints the edge. */
  .map-ui #map :is(.lens-chip, .lens-card, .lens-next) {
    border-color: color-mix(in srgb, var(--accent, #fff6fb) 34%, rgba(255, 255, 255, .16));
    background: rgba(22, 17, 34, .9);
    box-shadow: 0 4px 12px rgba(6, 4, 14, .22);
  }
  .map-ui #map .lens-chip { font-weight: 600; }
  .map-ui #map .lens-card { border-radius: 16px; }
  .map-ui #map :is(.lens-chip[aria-pressed="true"], .lens-card[aria-current="true"]) {
    border-color: transparent;
    background: var(--accent, #ffd363);
  }
}

/* Phone header: everything fits the width, nothing is cut at the edge. */
@media (max-width: 480px) {
  .mast { gap: 3px; padding-inline: 8px; }
  .mast .brand img { width: 54px; height: auto; }
  .mast-more > summary { padding: 6px 6px; font-size: 0.78rem; }
  .mast nav { gap: 0; }
  .mast .nav-button { padding-inline: 5px; }
}
/* The theme switch is the one control a narrow phone can do without in the header. */
@media (max-width: 400px) { .mast .theme-toggle { display: none; } }
@media (max-width: 340px) { .mast .nav-button span { display: none; } }

/* Full-screen map: the page chrome and the filters step aside until the same button is pressed again. */
.map-ui #map-full .map-full-leave,
.map-ui #map-full[aria-pressed="true"] .map-full-enter { display: none; }
.map-ui #map-full[aria-pressed="true"] .map-full-leave { display: inline; }
.map-ui #map #map-full[aria-pressed="true"] { color: #ffd28d; }
html.map-full .map-ui > .mast,
html.map-full .map-ui > #map-session-entry,
html.map-full .map-ui > #trophy-map,
html.map-full .map-ui #sidebar,
html.map-full .map-ui #sheet-backdrop,
html.map-full .map-ui #map > .map-top,
html.map-full .map-ui #map > #collection-bar,
html.map-full .map-ui #map > #cartography-shortcut,
html.map-full .map-ui #map > #feature-wrap,
html.map-full .map-ui #map > #lens-caption,
html.map-full .map-ui #map > #lens-strip,
html.map-full .map-ui #map > #lens-rail,
html.map-full .map-ui #map > #lens-dock,
html.map-full .map-ui #map > .map-footer { display: none !important; }
html.map-full .map-ui > .workspace {
  display: block;
  height: 100dvh !important;
}
html.map-full .map-ui #map { width: 100%; height: 100%; }
html.map-full .map-ui #map .map-tools { margin-right: env(safe-area-inset-right); }
