/* Full-screen map behind the sheet */
.map { position: fixed; inset: 0; z-index: 0; background: var(--color-map-bg); }
/* Map pages are fixed layers (map + sheet); the document itself must never scroll, or iOS
   shifts everything when the keyboard opens. */
html:has(body.page-map), body.page-map { height: 100%; overflow: hidden; overscroll-behavior: none; }
.map__canvas { position: absolute; inset: 0; }
.leaflet-container { font-family: var(--font-sans); background: var(--color-map-bg); }
/* Strictly monochrome base map (lib/map_tiles.js); only the tiles, not our markers/overlays. */
.leaflet-tile-pane { filter: grayscale(1); }

/* Alert area (map_controller#setupArea): screen overlay above tiles and shapes, below
   markers (Leaflet marker pane is z-index 600); taps pass through to the map. */
.map-area-shade {
  position: absolute; inset: 0; z-index: 450; pointer-events: none;
  background: radial-gradient(circle var(--area-r, 0px) at var(--area-x, 50%) var(--area-y, 50%),
                              transparent calc(var(--area-r, 0px) - 0.5px), rgb(0 0 0 / 0.45) var(--area-r, 0px));
}
.map-area-shade::after {
  content: ""; position: absolute; box-sizing: border-box;
  left: calc(var(--area-x) - var(--area-r)); top: calc(var(--area-y) - var(--area-r));
  width: calc(var(--area-r) * 2); height: calc(var(--area-r) * 2);
  border: 2px solid #fff; border-radius: 50%;
}

/* Map attribution (lib/map_tiles.js): vertical along the right edge, reading bottom to top,
   starting below the Alert Me button so it stays in the part of the map the sheet leaves. */
.leaflet-top.leaflet-right .leaflet-control-attribution {
  writing-mode: vertical-rl; transform: rotate(180deg);
  margin: calc(var(--alert-me-height) + var(--space-5)) 0 0 0;
  padding: var(--space-2) 2px; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: var(--color-glass-faint); color: var(--color-text-muted);
  font-size: 10px; line-height: 1.2; white-space: nowrap;
}
.leaflet-top.leaflet-right .leaflet-control-attribution a { color: inherit; }

/* Item dot label (map_controller#itemLabel): dark like the pin labels; the title up to two
   lines, the subtitle one. Rounded rather than a pill, which would clip a two-line title. */
.map-popup .leaflet-popup-content-wrapper {
  padding: 0; border-radius: var(--radius-md); background: var(--color-popup); color: #fff;
  box-shadow: 0 0 0 1px var(--color-popup-edge), var(--shadow-md);
}
.map-popup .leaflet-popup-content { margin: 0; line-height: var(--leading-tight); }
.map-popup .leaflet-popup-tip { background: var(--color-popup); box-shadow: none; }
/* .leaflet-container prefix beats Leaflet's own `.leaflet-container a` link color */
.leaflet-container .map-popup__link {
  display: flex; flex-direction: column; gap: 2px; max-width: 220px;
  padding: var(--space-2) var(--space-5); color: #fff; text-decoration: none;
}
.map-popup__title, .map-popup__subtitle { overflow: hidden; text-overflow: ellipsis; }
.map-popup__title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
}
.map-popup__subtitle { white-space: nowrap; }
.map-popup__subtitle { font-size: var(--text-xs); opacity: 0.8; }

/* Agenda item dots (map_controller dotIcon): solid series color, soft shadow, fixed size.
   The icon box is a larger, invisible tap target with the dot drawn at its middle. */
.map-dot-icon { background: none; border: 0; display: flex; align-items: center; justify-content: center; }
.map-dot {
  display: block; width: 14px; height: 14px; border-radius: 50%;
  background: var(--dot-color); box-shadow: 0 1px 3px rgb(0 0 0 / 0.35), 0 0 1px rgb(0 0 0 / 0.25);
}
.map-dot-icon.leaflet-interactive { cursor: pointer; }
/* The selected item's dots (all of them, when it has several locations): larger, ringed. */
.map-dot.is-active {
  transform: scale(1.35);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--dot-color), 0 1px 4px rgb(0 0 0 / 0.4);
}
.map-dot-icon:has(.map-dot.is-active) { z-index: 1000 !important; }
/* agendas#index zoomed out (lib/place_bubbles): how many meetings each place has, sized by the
   count (--bubble-size), in the place's color (--bubble-color, as its list row's dot), a little
   see-through so the map shows under it, with a white count. */
.map-bubble-icon { background: none; border: 0; display: flex; align-items: center; justify-content: center; }
.map-bubble {
  display: flex; align-items: center; justify-content: center;
  width: var(--bubble-size); height: var(--bubble-size); border-radius: 50%;
  background: color-mix(in srgb, var(--bubble-color, var(--color-primary)) 85%, transparent); color: #fff;
  font-size: var(--text-md); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
}
.map-bubble-icon.leaflet-interactive { cursor: pointer; }
.map-bubble-icon.leaflet-interactive:hover .map-bubble,
.map-bubble-icon:focus-visible .map-bubble { transform: scale(1.08); }

/* The meeting place on agenda pages (MapFeature.for_meeting): a small gray dot, smaller than an
   item's and under them, ringed so it shows on light and dark tiles. */
.map-meeting-dot {
  display: block; width: 12px; height: 12px; border-radius: 50%;
  background: var(--color-meeting-dot); box-shadow: 0 0 0 2px var(--color-meeting-ring), 0 1px 3px rgb(0 0 0 / 0.3);
}
/* The ad (map_controller starIcon): a gold star; its label opens when it's clicked. */
.map-star-icon { background: none; border: 0; }
.map-star { display: block; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.35)); }
.map-star-icon.leaflet-interactive { cursor: pointer; }
.map--area .map-star-icon { cursor: grab; pointer-events: none; } /* not clickable under the Alert Me circle */
