.wl-visitors {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}
.wl-visitor {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}
.wl-visitor[hidden] { display: none; }
.wl-living-gems {
  position: fixed;
  inset: 0;
  z-index: 998;
  pointer-events: none;
}
.wl-living-gem {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  touch-action: manipulation;
}
.wl-living-gem[hidden] { display: none; }
.wl-living-gem > wl-diamond {
  display: block;
  width: 32px;
  height: 32px;
  pointer-events: none;
  opacity: var(--gem-life, 1);
  filter: drop-shadow(0 0 5px currentColor);
  transition: opacity 1s linear;
}
.wl-living-gem canvas { display: block; width: 100%; height: 100%; }
.wl-living-gem:hover > wl-diamond,
.wl-living-gem:focus-visible > wl-diamond { filter: drop-shadow(0 0 9px currentColor); }
.wl-living-gem:focus-visible { outline: 2px solid var(--cta); outline-offset: 0; }
/* The carousel's node: a rising stem, then a gem and its flag beside it. */
.wl-gem-line {
  position: absolute;
  bottom: 50%;
  left: calc(50% - .75px);
  width: 1.5px;
  height: 56px;
  background: var(--gem-colour);
  transform-origin: bottom;
}
.wl-gem-flags {
  position: absolute;
  bottom: calc(50% + 56px);
  left: 50%;
  display: flex;
  align-items: center;
  gap: .45rem;
  width: max-content;
  max-width: min(12rem, calc(100vw - 1rem));
  color: var(--gem-colour);
  font: 400 1.25rem/1.5 var(--wl-font-body);
  transform: translate(var(--gem-flags-shift, -12px), 50%);
}
.wl-gem-flags > wl-diamond {
  display: block;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}
.wl-gem-countries { min-width: 0; overflow-wrap: anywhere; text-align: left; }
.wl-gem-line, .wl-gem-flags { pointer-events: none; visibility: hidden; }
.wl-gem-line[hidden], .wl-gem-flags[hidden] { display: none; }
.wl-living-gem:is(:hover, :focus-visible) .wl-gem-line {
  visibility: visible;
  animation: wl-gem-line-grow 260ms cubic-bezier(.3, .7, .2, 1) both;
}
.wl-living-gem:is(:hover, :focus-visible) .wl-gem-flags {
  visibility: visible;
  animation: wl-gem-tag-rise 320ms 170ms cubic-bezier(.34, 1.56, .64, 1) both;
}
.wl-living-gem:is(:hover, :focus-visible) .wl-gem-flags > * {
  -webkit-mask-size: var(--wl-dither-in-tile);
  mask-size: var(--wl-dither-in-tile);
  animation: wl-dither-in 360ms step-end 160ms both;
}
.wl-living-gem:is(:hover, :focus-visible) .wl-gem-countries { animation-delay: 230ms; }
.wl-gem-flags-flip .wl-gem-flags { flex-direction: row-reverse; }
.wl-gem-flags-below .wl-gem-line { bottom: auto; top: 50%; transform-origin: top; }
.wl-gem-flags-below .wl-gem-flags { bottom: auto; top: calc(50% + 56px); transform: translate(var(--gem-flags-shift, -12px), -50%); }
.wl-gem-touched > wl-diamond { animation: wl-gem-touch .45s ease-out; }
@keyframes wl-gem-touch { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes wl-gem-line-grow { from { scale: 1 0; } to { scale: 1 1; } }
@keyframes wl-gem-tag-rise { from { translate: 0 6px; } to { translate: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .wl-living-gem > wl-diamond { transition: none; animation: none; }
  .wl-living-gem:is(:hover, :focus-visible) :is(.wl-gem-line, .wl-gem-flags, .wl-gem-flags > *) { animation: none; }
}
.wl-visitor-trails {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.wl-visitor-trails[hidden] { display: none; }
.wl-visitor > canvas {
  display: block;
  width: 64px;
  height: 64px;
  position: absolute;
  left: -32px;
  top: -32px;
}
.wl-artifact-cursor {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* over the tips (wl-tip.js, 1002) and the floating panels */
  z-index: 1003;
}
.wl-artifact-cursor[hidden] { display: none; }
html.wl-artifact-active,
html.wl-artifact-active *,
html.wl-artifact-active *::before,
html.wl-artifact-active *::after { cursor: none !important; }
/* Shared widget cursor owns only the hovered widget, never the site surface.
   The :hover gate also clears it immediately when a panel closes. */
#ll-widget-cursor { visibility: hidden; }
body:has([data-wl-widget-hover]:hover) #ll-widget-cursor { visibility: visible; }
body:has(#ll-widget-cursor:not([data-state="hidden"])) [data-wl-widget-hover]:hover,
body:has(#ll-widget-cursor:not([data-state="hidden"])) [data-wl-widget-hover]:hover * { cursor: none !important; }
.wl-visitor span { position: absolute; left: 13px; top: -6px; font-size: 12px; }
.wl-visitor .wl-visitor-name {
  max-width: min(15rem, 55vw);
  padding: .15rem .4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  background: var(--panel);
  font: 500 .85rem/1.4 var(--wl-font-body);
}
/* Zero specificity preserves existing absolute/fixed positioning (e.g. the deck). */
:where(a:has(> .wl-visitor-badge)) { position: relative; }
.wl-visitor-badge {
  position: absolute;
  top: -.6rem;
  right: -.65rem;
  z-index: 2;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25em;
  margin: 0;
  padding: .1em .4em;
  border: 0;
  font: 700 12px/1.4 var(--wl-font-mono);
  color: var(--ink);
  background: var(--lift);
}

/* Product tiles and image cards keep the count inside their upper-right corner. */
.hm-pick-app > .wl-visitor-badge,
.hm-phone > .wl-visitor-badge { top: .5rem; right: .5rem; }
.hm-card-mark > .wl-visitor-badge { top: 0; right: 0; }

/* A small instrument panel: brand faces, tonal surfaces, square controls. */
.wl-presence-control {
  position: fixed;
  bottom: max(var(--wl-gap), env(safe-area-inset-bottom));
  left: max(var(--wl-gap), env(safe-area-inset-left));
  z-index: 1001;
  max-width: calc(100vw - 2 * var(--wl-gap));
  max-height: calc(100dvh - 2 * var(--wl-gap) - env(safe-area-inset-bottom));
  overflow-y: auto;
  padding: 0;
  border: 0;
  background: var(--bg-deep);
  background-image: linear-gradient(var(--panel), var(--panel));
  color: var(--ink);
  font: 400 1rem/1.45 var(--wl-font-body);
}
.wl-presence-control[open] { width: 22rem; }
.wl-presence-control summary {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  padding: .5rem var(--wl-pad);
  background: var(--lift);
  cursor: pointer;
  list-style: none;
  font: 650 .85rem/1.2 var(--wl-font-head);
  text-transform: uppercase;
  letter-spacing: .1em;
  transition: background var(--wl-out);
}
.wl-presence-control summary::-webkit-details-marker { display: none; }
.wl-presence-control .wl-presence-credit {
  display: block;
  margin-top: 1rem;
  color: var(--muted);
  font: 400 12px/1.3 var(--wl-font-body);
  text-transform: none;
  letter-spacing: normal;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.wl-presence-control .wl-presence-credit:hover { color: var(--ink); }
.wl-presence-control summary:hover,
.wl-presence-control[open] summary {
  background: color-mix(in oklab, var(--accent) 22%, var(--lift));
}
.wl-presence-control summary wl-diamond {
  display: block;
  flex: none;
  width: 24px;
  height: 24px;
  color: var(--accent);
  pointer-events: none;
}
.wl-presence-control summary canvas { display: block; width: 100%; height: 100%; }
.wl-presence-control summary::after {
  content: '';
  width: 8px;
  height: 5px;
  margin-left: auto;
  background: var(--muted);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.wl-presence-control[open] summary::after { transform: rotate(180deg); }
.wl-presence-panel { padding: var(--wl-pad); }
.wl-presence-panel label {
  display: flex;
  align-items: center;
  gap: var(--wl-gap);
  min-height: 44px;
  margin: .5rem 0 0;
  padding: .65rem var(--wl-gap);
  background: var(--lift);
  cursor: pointer;
}
.wl-presence-panel label:has(input:checked) {
  background: color-mix(in oklab, var(--accent) 16%, var(--lift));
}
.wl-presence-panel label:hover {
  background: color-mix(in oklab, var(--accent) 24%, var(--lift));
}
.wl-presence-panel input[type='checkbox'] {
  appearance: none;
  display: grid;
  place-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--muted);
  cursor: pointer;
}
.wl-presence-panel input:checked { background: var(--accent); }
.wl-presence-panel input:checked::after {
  content: '';
  width: 12px;
  height: 10px;
  background: var(--ink);
  clip-path: polygon(0 45%, 20% 25%, 40% 50%, 80% 0, 100% 20%, 40% 100%);
}
.wl-presence-control .wl-presence-status {
  display: block;
  margin-top: var(--wl-gap);
  padding: .5rem var(--wl-gap);
  background: var(--bg-deep);
  color: var(--muted);
  font: 400 .9rem/1.4 var(--wl-font-mono);
}
.wl-presence-hint {
  display: block;
  margin: .5rem var(--wl-gap);
  color: var(--muted);
  font: 400 .85rem/1.4 var(--wl-font-body);
}
.wl-presence-hint[hidden] { display: none; }
.wl-presence-panel label:has(input:disabled) { cursor: default; }
.wl-presence-signin {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: var(--wl-gap);
  padding: .6rem var(--wl-gap);
  border: 0;
  background: var(--lift);
  color: var(--ink);
  font: 600 1rem/1.4 var(--wl-font-body);
  cursor: pointer;
}
.wl-presence-signin:hover { background: color-mix(in oklab, var(--accent) 24%, var(--lift)); }
.wl-presence-signin[hidden] { display: none; }
.wl-presence-roster-heading {
  margin: 1rem 0 .5rem;
  color: var(--muted);
  font: 600 .85rem/1.4 var(--wl-font-head);
}
.wl-presence-roster { list-style: none; margin: 0; padding: 0; }
.wl-presence-roster li {
  display: flex;
  align-items: center;
  gap: var(--wl-gap);
  min-height: 44px;
  padding: .65rem .75rem .65rem .5rem;
  background: var(--lift);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.wl-presence-roster li + li { margin-top: .25rem; }
.wl-presence-person-gem { display: block; flex: 0 0 40px; width: 40px; height: 40px; }
.wl-presence-person-gem canvas { display: block; width: 100%; height: 100%; }
.wl-presence-roster li > div { min-width: 0; }
.wl-presence-person-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font: 500 1rem/1.4 var(--wl-font-body);
}
a.wl-presence-person-name { text-decoration: underline; text-underline-offset: 3px; }
.wl-presence-person-name:hover { color: var(--accent); }
.wl-presence-roster small { display: block; overflow-wrap: anywhere; color: var(--muted); font: 400 .85rem/1.4 var(--wl-font-body); }
.wl-presence-empty { margin: .5rem 0 0; color: var(--muted); font-size: .9rem; }
.wl-presence-empty[hidden] { display: none; }
.wl-presence-control summary:focus-visible,
.wl-presence-panel input:focus-visible,
.wl-presence-signin:focus-visible,
.wl-presence-person-name:focus-visible {
  outline: 2px solid var(--cta);
  outline-offset: -2px;
}
@media (prefers-reduced-motion: reduce) {
  .wl-visitor, .wl-presence-control summary { transition: none; }
}
@media (forced-colors: active) {
  .wl-presence-panel input[type='checkbox'] { appearance: auto; }
  .wl-presence-panel input:checked::after { display: none; }
}

.wl-presence-country-tab {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: .25rem;
  padding: .1rem .6rem .1rem .35rem;
  color: var(--ink);
  background: var(--bg-deep);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 0 100%);
}
.wl-presence-country-tab small { font: 500 .7rem/1.4 var(--wl-font-mono); }
.wl-presence-person-symbol { color: var(--person-colour); font: 600 1.1rem/1 var(--wl-font-body); }
.wl-presence-appearance { margin-top: 1rem; }
.wl-presence-appearance fieldset { padding: 0; margin: .75rem 0; border: 0; min-width: 0; }
.wl-presence-appearance legend { padding: 0 0 .35rem; color: var(--muted); font: 600 .85rem/1.4 var(--wl-font-head); }
.wl-presence-choices { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .25rem; }
.wl-presence-choices button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 44px;
  padding: .25rem;
  border: 0;
  background: var(--lift);
  color: var(--person-colour);
  font: 500 1.35rem/1 var(--wl-font-body);
}
.wl-presence-swatch { display: block; width: 24px; height: 24px; background: var(--choice-colour); }
.wl-presence-choices button:is(:hover, [aria-pressed='true']) { background: color-mix(in oklab, var(--person-colour) 20%, var(--lift)); }
.wl-presence-choices button[aria-pressed='true'] { box-shadow: inset 0 -3px var(--cta); }
.wl-presence-choices button:focus-visible { outline: 2px solid var(--cta); outline-offset: -2px; }
@media (forced-colors: active) {
  .wl-presence-roster li, .wl-presence-country-tab { clip-path: none; }
  .wl-presence-choices button { border: 1px solid ButtonText; }
  .wl-presence-choices button[aria-pressed='true'] { outline: 2px solid Highlight; }
}

/* Portable cursor preferences, alongside the visitor's gem controls. */
.wl-site-cursor { margin: 0 0 1rem; padding: .75rem; border: 0; background: var(--lift); }
.wl-site-cursor legend { padding: .4rem .65rem; background: var(--panel); color: var(--accent); font-weight: 650; text-transform: uppercase; font-size: .8rem; letter-spacing: .1em; }
.wl-site-cursor select { margin-left: auto; min-height: 36px; background: var(--bg-deep); color: var(--ink); border: 0; font: inherit; }
.wl-site-cursor input[type='color'] { margin-left: auto; width: 44px; height: 32px; padding: 2px; border: 0; background: var(--bg-deep); }
.wl-site-cursor small,.wl-site-cursor a { display: block; font-size: .75rem; line-height: 1.4; margin-top: .5rem; }
.wl-site-cursor input:disabled,.wl-site-cursor select:disabled { opacity: .5; }
