/* LetterMap live viewers (loaded only when PRESENCE_ENABLED is true). */
:root { --lm-view: #2563eb; --lm-me: #0d9488; }
.lm-live-pane { pointer-events: none; }
.lm-live { background: none; border: 0; pointer-events: none; }
.lm-live-ring { position: relative; width: 68px; height: 68px; opacity: 0; transition: opacity .8s; }
.lm-live-ring.lm-in { opacity: 1; }
.lm-live-ring::before, .lm-live-ring::after { content: ""; position: absolute; border-radius: 50%; box-sizing: border-box; }
.lm-live-ring::before {
  inset: 0; border: 3px solid var(--c); background: color-mix(in srgb, var(--c) 24%, transparent);
  animation: lm-live-pulse 2.6s ease-in-out infinite; animation-delay: var(--d, 0s);
}
.lm-live-ring::after { left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; background: var(--c); opacity: .85; }
.lm-live-near { width: 120px; height: 120px; }
.lm-live-near::before { border-width: 2px; background: color-mix(in srgb, var(--c) 12%, transparent); }
.lm-live-near::after { width: 6px; height: 6px; margin: -3px 0 0 -3px; opacity: .22; }
.lm-live-view { --c: var(--lm-view); }
.lm-live-me { --c: var(--lm-me); }
@keyframes lm-live-pulse {
  0%, 100% { transform: scale(.6); opacity: 1; }
  50% { transform: scale(1.15); opacity: .4; }
}
@keyframes lm-live-pulse-near {
  0%, 100% { transform: scale(.72); opacity: .7; }
  50% { transform: scale(1.08); opacity: .28; }
}
.lm-live-near::before { animation-name: lm-live-pulse-near; }
@media (prefers-reduced-motion: reduce) {
  .lm-live-ring::before { animation: none; opacity: .75; transform: scale(.9); }
  .lm-live-near::before { opacity: .45; transform: scale(.95); }
  .lm-live-ring { transition: none; }
}
/* control, top right of the map */
.lm-live-ctl { margin: 10px 10px 0 0 !important; text-align: right; font-size: .85rem; color: #0f172a; }
.lm-live-toggle {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid #e2e8f0; background: #fff; border-radius: 999px; padding: 6px 12px 6px 8px;
  color: #0f172a; font: inherit; box-shadow: 0 1px 4px rgba(15, 23, 42, .12); white-space: nowrap;
}
.lm-live-toggle:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; }
.lm-live-sw { width: 30px; height: 18px; border-radius: 9px; background: #cbd5e1; position: relative; transition: background .25s; flex: none; }
.lm-live-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .25s; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.lm-live-toggle[aria-checked="true"] .lm-live-sw { background: var(--lm-me); }
.lm-live-toggle[aria-checked="true"] .lm-live-sw::after { left: 14px; }
.lm-live-modes { margin: 6px 0 0 auto; display: block; width: max-content; }
.lm-live-seg {
  display: inline-flex; border: 1px solid #e2e8f0; background: #fff; border-radius: 999px;
  overflow: hidden; box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
}
.lm-live-seg-btn {
  border: 0; background: transparent; padding: 4px 11px; margin: 0; cursor: pointer;
  font: inherit; font-size: .8rem; color: #475569; line-height: 1.3;
}
.lm-live-seg-btn:focus-visible { outline: 2px solid #1d4ed8; outline-offset: -2px; }
.lm-live-seg-btn[aria-checked="true"] { background: #0f172a; color: #fff; }
.lm-live-hint { margin: 4px 0 0 auto; display: block; width: max-content; max-width: 220px; text-align: right; font-size: .74rem; line-height: 1.3; color: #334155; background: rgba(255, 255, 255, .85); border-radius: 8px; padding: 2px 8px; }
.lm-live-legend {
  margin: 6px 0 0 auto; display: block; width: max-content; text-align: left; background: rgba(255, 255, 255, .95);
  border: 1px solid #e2e8f0; border-radius: 10px; padding: 6px 12px; line-height: 1.7; box-shadow: 0 1px 6px rgba(15, 23, 42, .12);
}
.lm-live-legend div { white-space: nowrap; }
.lm-live-lg-me { --c: var(--lm-me); }
.lm-live-lg-view { --c: var(--lm-view); }
.lm-live-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--c); background: color-mix(in srgb, var(--c) 20%, transparent); vertical-align: -2px; margin-right: 6px; }
.lm-live-note { margin: 6px 0 0 auto; display: block; width: max-content; max-width: 70vw; background: rgba(255, 255, 255, .95); border: 1px solid #e2e8f0; border-radius: 10px; padding: 4px 10px; font-size: .78rem; color: #475569; }
@media (max-width: 600px) {
  .lm-live-ctl { margin: 8px 8px 0 0 !important; }
  .lm-live-toggle { padding: 5px 10px 5px 7px; font-size: .8rem; }
  .lm-live-t-long { display: none; }
  .lm-live-seg-btn { padding: 3px 8px; font-size: .75rem; }
  .lm-live-hint { max-width: 46vw; font-size: .7rem; }
}
@media (min-width: 601px) { .lm-live-t-short { display: none; } }
