@layer components {
  /* ── Status picker button (map page, bottom-left) ── */

  .status-picker__wrap {
    position: absolute;
    bottom: 2rem;
    left: 1rem;
    z-index: 1000;
  }

  .group-map__status-btn {
    width: var(--touch-min);
    height: var(--touch-min);
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px oklch(0% 0 0 / 0.3);
    transition: background 150ms ease, border-color 150ms ease;

    & svg {
      width: 1.25rem;
      height: 1.25rem;
    }

    &:hover {
      border-color: oklch(var(--lch-uv) / 0.4);
      background: color-mix(in oklch, var(--color-surface) 80%, oklch(var(--lch-uv)) 20%);
    }
  }

  /* ── Status picker popover (bottom sheet) ── */

  .status-picker {
    margin: 0;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg, 0.75rem);
    background: var(--color-surface);
    color: var(--color-ink);
    box-shadow: 0 8px 32px oklch(0% 0 0 / 0.25);
    min-width: 16rem;
    max-width: 20rem;

    position: fixed;
    inset: auto auto 1rem auto;
    margin-inline: auto;

    opacity: 1;
    translate: 0;
    transition:
      opacity 120ms ease,
      translate 120ms ease,
      overlay 120ms ease allow-discrete,
      display 120ms ease allow-discrete;

    @starting-style {
      opacity: 0;
      translate: 0 0.5rem;
    }
  }

  .status-picker__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-block-end: 1px solid var(--color-border);
    font-size: 0.875rem;
  }

  .status-picker__clear {
    font-size: 0.8125rem;
    color: var(--color-negative);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;

    &:hover {
      text-decoration: underline;
    }
  }

  .status-picker__options,
  .status-picker__target-list {
    padding-block: 0.25rem;
  }

  .status-picker__item,
  .status-picker__target {
    display: flex;
    align-items: center;
    gap: var(--inline-space);
    width: 100%;
    min-height: var(--touch-min);
    padding: 0.5rem 1rem;
    font: inherit;
    font-size: 0.875rem;
    color: var(--color-ink);
    background: none;
    border: none;
    text-align: start;
    cursor: pointer;
    transition: background 80ms ease;

    &:hover {
      background: color-mix(in oklch, var(--color-ink) 6%, transparent);
    }
  }

  .status-picker__emoji {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 1.75rem;
    text-align: center;
  }

  .status-picker__chevron {
    width: 1rem;
    height: 1rem;
    margin-inline-start: auto;
    color: var(--color-ink-muted);
  }

  .status-picker__prompt {
    padding: 0.75rem 1rem 0.25rem;
    font-size: 0.8125rem;
    color: var(--color-ink-muted);
    margin: 0;
  }

  /* ── Pin badge (emoji on map marker) ── */

  .group-map__pin-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 0.75rem;
    line-height: 1;
    background: var(--color-surface);
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 1px 4px oklch(0% 0 0 / 0.3);
  }

  /* ── Popup status variant ── */

  .group-map__popup-status--status {
    color: oklch(var(--lch-uv));
    font-weight: 600;
  }

  /* ── Member status badge (member list + chips) ── */

  .member-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25ch;
    font-size: 0.6875rem;
    padding: 0.0625rem 0.5rem;
    border-radius: var(--radius-pill, 100vw);
    font-weight: 600;
  }

  .member-status-badge--at_stage {
    background: color-mix(in oklch, oklch(var(--lch-uv)) 15%, var(--color-surface));
    color: oklch(var(--lch-uv));
  }

  .member-status-badge--at_camp {
    background: color-mix(in oklch, oklch(var(--lch-sky)) 15%, var(--color-surface));
    color: oklch(var(--lch-sky));
  }

  .member-status-badge--food_and_bar {
    background: color-mix(in oklch, oklch(var(--lch-golden)) 15%, var(--color-surface));
    color: oklch(var(--lch-golden));
  }

  .member-status-badge--toilet_queue {
    background: color-mix(in oklch, oklch(var(--lch-laser)) 15%, var(--color-surface));
    color: oklch(var(--lch-laser));
  }

  .member-status-badge--lost {
    background: color-mix(in oklch, oklch(var(--lch-flare)) 15%, var(--color-surface));
    color: oklch(var(--lch-flare));
  }

  .member-status-badge--heading_to_you {
    background: color-mix(in oklch, var(--color-positive) 15%, var(--color-surface));
    color: var(--color-positive);
  }

  .member-chip__badge--status {
    background: color-mix(in oklch, oklch(var(--lch-uv)) 15%, var(--color-surface));
    color: oklch(var(--lch-uv));
  }
}
