.map-page main { isolation: isolate; }
.map-page.signed-in { --map-status-top: 3.25rem; }
#map-tools {
  position: absolute; top: 0.75rem; left: 0.75rem; z-index: 2; display: flex; gap: 3px;
  max-width: calc(100% - 5rem); padding: 2px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card); color: var(--fg); box-shadow: 0 2px 12px #0003;
}
#map-tools[hidden] { display: none; }
#map-tools button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 6px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 0.82rem; font-weight: 500;
}
#map-tools button[hidden] { display: none; }
#map-tools button svg { width: 16px; height: 16px; flex-shrink: 0; }
#map-tools button:hover { color: var(--fg); background: #ffffff0d; }
#map-tools button[aria-pressed="true"], #map-tools button[aria-expanded="true"] { color: var(--fg); background: #7dab8f30; }
#map-tools button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 640px) {
  .map-page #map-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); left: 0.5rem; right: auto; width: min(240px, calc(100% - 5rem)); max-width: calc(100% - 1rem); }
  .map-page #map-tools[hidden] { display: none; }
  .map-page #map-tools button { flex-direction: column; min-width: 0; min-height: 60px; padding: 4px; gap: 2px; font-size: 0.75rem; }
  .map-page #map-tools button span { overflow-wrap: anywhere; }
  .map-page.signed-in { --map-status-top: 5.5rem; }
  .map-page #details-heading { flex-wrap: wrap; gap: 0.5rem; }
  .map-page #selection-heading { flex: 1 1 12rem; overflow-wrap: anywhere; }
  .map-page #details-actions { margin-left: auto; }
  .map-page.planning #details { top: 5.5rem; padding-top: 1rem; }
}
