/* hymaps-rail.css — right FAB rail + Add chooser (rail-fab agent)
 * ──────────────────────────────────────────────────────────────────────────
 * Owns the trimmed primary right rail (Locate / Layers / Voice / Add + a
 * conditional compass) and the merged Add popover. THEME ONLY: every value
 * references a token/alias from tokens.css / hymaps-glass.css — no literal hex
 * or brand colors. Mobile-first, 8px spacing grid, safe-area aware.
 *
 * Z-INDEX (spec): rail + #hm-add-menu = 1300 (sits ABOVE the bottom control
 * deck @1200 so the FABs are always tappable).
 *
 * Integration seam: the rail floats above the deck's collapsed peek using
 * --hm-deck-collapsed-h. The map-deck module/integrator should set this var
 * to the deck's resting height (e.g. on :root) so FABs never overlap the deck;
 * it defaults to a safe edge inset when no deck is present.
 */

:root {
  --hm-deck-collapsed-h: 12px; /* overridden by the bottom control deck */
}

/* ── Rail container ───────────────────────────────────────────────────────── */
#hm-rail.hm-fab-rail {
  z-index: 1300;
  right: calc(var(--space-md) + var(--safe-right, 0px));
  bottom: calc(var(--hm-deck-collapsed-h, 12px) + var(--space-md) + var(--hm-safe-b));
  gap: 10px;
}

/* Conditional compass: shown only when the map is rotated (toggled in JS). */
#hm-rail .hm-fab[hidden] { display: none; }

/* ── Layers active-count badge (mirrors the live-layers count) ─────────────── */
#hm-layers-btn { position: relative; overflow: visible; }
.hm-rail-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 var(--space-xs);
  border-radius: var(--radius-full);
  background: var(--hm-accent); color: var(--hm-bg);
  font-size: var(--font-size-xs); font-weight: 700; line-height: 18px;
  text-align: center; box-shadow: var(--shadow-sm);
}
.hm-rail-badge[hidden] { display: none; }

/* ── Add chooser popover (Report incident / Add place) ─────────────────────── */
.hm-add-menu {
  position: fixed; z-index: 1300;
  right: calc(var(--space-md) + var(--safe-right, 0px));
  bottom: calc(var(--hm-deck-collapsed-h, 12px) + var(--space-md) + var(--hm-safe-b) + 72px);
  display: flex; flex-direction: column; gap: var(--space-sm);
  min-width: 200px; padding: var(--space-sm);
  border-radius: var(--hm-radius);
  background: var(--hm-glass);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border: 1px solid var(--hm-border);
  box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(.98); transform-origin: bottom right;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.hm-add-menu.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.hm-add-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: var(--touch-target); padding: var(--space-sm) var(--space-md);
  border: 1px solid transparent; border-radius: var(--radius-md);
  background: transparent; color: var(--hm-text);
  font: inherit; font-size: var(--font-size-md); font-weight: 600;
  text-align: left; cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.hm-add-item iconify-icon { font-size: 22px; color: var(--hm-accent); flex: none; }
.hm-add-item:hover,
.hm-add-item:focus-visible { background: var(--hm-card); border-color: var(--hm-border); }

@media (prefers-reduced-motion: reduce) {
  .hm-add-menu { transition: none; }
}
