@layer app {
  /* ============================================================
     Location-specific styles
     ============================================================ */

  .location-card {
    transition: all 0.2s ease;

    &:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-lg);
    }
  }

  .location-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .location-members-tag {
    align-items: center;
    display: inline-flex;
    gap: 0.35rem;
  }

  /* Sits tight against the location name. */
  .location-membership {
    align-items: center;
    display: inline-flex;
    flex-shrink: 0;
  }

  .location-membership__joined {
    background: none;
    border: 0;
    color: var(--color-success);
    display: inline-flex;
    font-size: 0.75rem;
    line-height: 1;
    padding: 0;
    /* Rides a little above the name's centre line. Transform rather than a
       margin so the confirm/cancel pair it swaps with stays put. */
    transform: translateY(-0.35rem);
  }

  /* Pressing the check swaps it for the confirm/cancel pair, sized to sit level
     with the members badge beside it. */
  .location-membership__confirm {
    display: none;
    gap: 0.35rem;

    .btn {
      font-size: 0.75rem;
      line-height: 1;
      padding: 0.35em 0.65em;
    }
  }

  .location-membership--leaving {
    .location-membership__joined {
      display: none;
    }

    .location-membership__confirm {
      display: inline-flex;
    }
  }

  .location-tabs {
    flex-wrap: nowrap;
    gap: clamp(0.25rem, 1.5vw, 0.5rem);

    .nav-link {
      border-radius: 999px;
      color: color-mix(in srgb, var(--color-dark) 60%, transparent);
      font-size: clamp(0.875rem, 3.75vw, 0.95rem);
      font-weight: 600;
      padding: 0.4rem clamp(0.55rem, 2.5vw, 0.75rem);
      border: 1px solid color-mix(in srgb, var(--color-dark) 8%, transparent);
      background: rgba(255, 255, 255, 0.55);
      white-space: nowrap;

      &.active {
        color: #fff;
        background: var(--color-primary);
        border-color: var(--color-primary);
      }
    }
  }
}
